]> git.ipfire.org Git - thirdparty/util-linux.git/commit
mount: use fflush() and temporary file for mtab updates (CVE-2011-1089)
authorKarel Zak <kzak@redhat.com>
Tue, 12 Apr 2011 20:52:33 +0000 (22:52 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 12 Apr 2011 20:52:33 +0000 (22:52 +0200)
commitceb012522c6c767a9c072705dd7b245cc696d1db
tree4c4a989f02f7d877f4c8573ef21a675d0a2bcdea
parent20f5be46ec57af3f21913c487000d69fb8857e18
mount: use fflush() and temporary file for mtab updates (CVE-2011-1089)

http://thread.gmane.org/gmane.comp.security.oss.general/4374

Changes:

  - force mount(8) to use /etc/mtab.tmp file every time. The original
    code used the tmp file for remount/move operations only.

  - call and check fflush() return code for the tmp file

Note mount(8) blocks all signals when writing to mtab, so it's not
affected by SIGXFSZ and the mtab lock file is always removed.

This patch does not fix the same issue in umount(8) and libmount.

Signed-off-by: Karel Zak <kzak@redhat.com>
mount/fstab.c
mount/mount.c