diff options
author | KaiGai Kohei | 2007-10-22 10:30:19 +0200 |
---|---|---|
committer | Karel Zak | 2007-10-25 21:50:36 +0200 |
commit | 71bf78844425d228de76db36c2f97e542c4c54fe (patch) | |
tree | 2477d9a347d02c60756f855e6a6de90abd7fb056 /README | |
parent | build-sys: add v2.14 to NEWS (diff) | |
download | kernel-qcow2-util-linux-71bf78844425d228de76db36c2f97e542c4c54fe.tar.gz kernel-qcow2-util-linux-71bf78844425d228de76db36c2f97e542c4c54fe.tar.xz kernel-qcow2-util-linux-71bf78844425d228de76db36c2f97e542c4c54fe.zip |
mkswap: possible to crash with SELinux relabeling support
When fgetfilecon() is failed with -ENODATA, this process does not
exit. However, "oldcontext" is not initialized in this case, so
context_new() will be called with uninitialized "oldcontext" at the
next.
Finally, it makes a segmentation fault, because context_new() have to
refer an incorrect memory region.
The attached patch fixes this matter using matchpathcon(). If we
cannot obtain actual file context due to -ENODATA, a context which is
returned by matchpathcon() is applied as oldcontext. Then, the type
of the context is relabeled to "swapfile_t" explicitly.
Signed-off-by: KaiGai Kohei <kaigai@kaigai.gr.jp>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions