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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABg4E-mbCk-jeRjETEtXk+ZHVub00_G5QaOnxbf5fgKd5MpD+A@mail.gmail.com>
Date:   Mon, 11 Feb 2019 14:59:29 -0500
From:   Tavian Barnes <tavianator@...ianator.com>
To:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: d_type and bind mounts

It seems that readdir()/getdents() fill d_type from the underlying
filesystem, not respecting bind mounts of non-directories:

$ touch mount_point
$ sudo mount --bind /dev/null mount_point
$ find -name mount_point -type c
$ find -name mount_point -type f
./mount_point

(Requires a fairly recent GNU findutils to reproduce, older ones
always call stat().)  I've seen similar discussions about d_ino being
for the underlying file, not the mount point, which people have said
is technically a POSIX violation but also unlikely to be fixed.  Is
the same true of d_type?  And is there some workaround a program could
use to get the actual type without the overhead of a whole stat()
call?  For example, a way to tell whether a directory entry is a mount
point?

For reference, the relevant findutils bug is
https://savannah.gnu.org/bugs/?54913.

(Please keep me cc'd, I'm not subscribed to lkml or fsdevel.  Thanks!)

-- 
Tavian Barnes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ