diff options
author | Karel Zak | 2011-04-13 10:11:50 +0200 |
---|---|---|
committer | Karel Zak | 2011-04-13 10:11:50 +0200 |
commit | d5bf8095091c2861ef2d60ceff4eba8049bb16af (patch) | |
tree | 336e98e1895e157cdd0e6bf516eb7cec0f4401a1 /mount | |
parent | mount: use fflush() and temporary file for mtab updates (CVE-2011-1089) (diff) | |
download | kernel-qcow2-util-linux-d5bf8095091c2861ef2d60ceff4eba8049bb16af.tar.gz kernel-qcow2-util-linux-d5bf8095091c2861ef2d60ceff4eba8049bb16af.tar.xz kernel-qcow2-util-linux-d5bf8095091c2861ef2d60ceff4eba8049bb16af.zip |
umount: block signals when umounting and updating mtab (CVE-2011-1676, CVE-2011-1677)
http://thread.gmane.org/gmane.comp.security.oss.general/4374
Based on CVE-2011-1089.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount')
-rw-r--r-- | mount/umount.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mount/umount.c b/mount/umount.c index add6c87da..c87af6b2c 100644 --- a/mount/umount.c +++ b/mount/umount.c @@ -291,6 +291,8 @@ umount_one (const char *spec, const char *node, const char *type, if (check_special_umountprog(spec, node, type, &status)) return status; + block_signals(SIG_BLOCK); + /* Skip the actual umounting for --fake */ if (fake) goto writemtab; @@ -357,6 +359,7 @@ umount_one (const char *spec, const char *node, const char *type, remnt.mnt_passno = 0; update_mtab(node, &remnt); } + block_signals(SIG_UNBLOCK); return 0; } else if (errno != EBUSY) { /* hmm ... */ perror("remount"); @@ -426,6 +429,8 @@ umount_one (const char *spec, const char *node, const char *type, #endif } + block_signals(SIG_UNBLOCK); + if (res >= 0) return 0; if (umnt_err) |