lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 16 Oct 2008 18:30:41 +0200
From:	Cyril Hrubis <metan@....cz>
To:	linux-kernel@...r.kernel.org
Subject: race condition in umount/statfs

Hi,
I've found that when umount command calls umount2() the process stays in
umount2() call till caches are flushed but entry in /etc/mtab is removed
after umount returns from umount2(). When df is invoked in the meantime,
it just returns statfs() for path from mtab, but as the filesystem
is not mounted in kernel anymore, you get statistics for another
filesystem instead (most likely /).

Example:  mount a usb flashdisk, copy some files there and then umount.
Cache flush on my machines is about 10 seconds.

As an fix I could call statfs() on parent directory and compare f_fsid, but
the manual says its set to zero on NFS and some systems.

--
metan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ