Repository navigation
syscall: traverse unstatable intermediate directories - #1171
Conversation
088b927 to
a9d5955
Compare
|
I think this could be raced. No well parent-held fd and the path could be called relatively containing a |
a9d5955 to
5074f19
Compare
|
@kkrrz test please. |
|
@seks99x Released 3.5.2 fails on these commands with Note: in my local build, configure did not define Thanks for the fix! |
|
Thanks for testing! |
62b98a9 to
0da0cbe
Compare
On Android, intermediate FUSE mount roots such as /storage/emulated fail fstatat(AT_SYMLINK_NOFOLLOW) with ENOENT (via vfs_getattr) even though their VFS dentry exists and resolves during path traversal. When an intermediate component (is_last == 0) in ona_open() fails fstatat() with ENOENT, fall back to opening the single component directly via openat(dfd, comp, dir_traverse_flags | O_NOFOLLOW). Because O_PATH | O_DIRECTORY | O_NOFOLLOW pins the VFS directory dentry without invoking vfs_getattr(), it traverses un-stat-able intermediate mount points while preserving atomic single-component O_NOFOLLOW/O_DIRECTORY checks, abspath tracking, and confinement.
0da0cbe to
84bc3d2
Compare
|
Im not with using building patched version , tests could be broke easily if the code is changed. Also please do not remove the test comments we can rather clean it, im not a big fan of them but some edge cases could be forgot or become too complex to read without a proper documentation/hinting. |
Missing or ambiguous patch targets now fail the test. The injection is documented; comments that just narrate the code will be staying out. |
Fixes #1170
Android FUSE mount roots such as
/storage/emulatedcan returnENOENTfromfstatat()even thoughopenat()can traverse the directory. The secure path walker previously stopped at the failed stat.When an intermediate component returns
ENOENT, the walker now tries to open that single component with its normal directory traversal flags plusO_NOFOLLOW. A successful descriptor rejoins the existing path tracking and confinement path. A failed open preserves its own error. Leaf handling is unchanged. Regression uses a deterministic test build to reproduce the Android behaviour. It covers absolute and relative traversal, missing descendants, intermediate symlink refusal and--confine-rootenforcement after the fallback.