]> 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, 19 Apr 2011 11:09:54 +0000 (13:09 +0200)
commit4b39b6aefd5dd8ac68a92adc650dc13d5d54d704
treed173d851a7ac6e5ad8f5b5ff7964eec4049afe5f
parentb0d983f61af6a592b4112f3f11b7c16dc40aacdc
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