diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2023-09-30 03:11:41 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-02-25 08:10:31 +0100 |
commit | cdb67fdeed72248475b1c849699495ef290a1634 (patch) | |
tree | e420dff77379ba8197a12b172b94320df2a81dcc /fs/affs/affs.h | |
parent | fs/super.c: don't drop ->s_user_ns until we free struct super_block itself (diff) | |
download | linux-cdb67fdeed72248475b1c849699495ef290a1634.tar.xz linux-cdb67fdeed72248475b1c849699495ef290a1634.zip |
rcu pathwalk: prevent bogus hard errors from may_lookup()
If lazy call of ->permission() returns a hard error, check that
try_to_unlazy() succeeds before returning it. That both makes
life easier for ->permission() instances and closes the race
in ENOTDIR handling - it is possible that positive d_can_lookup()
seen in link_path_walk() applies to the state *after* unlink() +
mkdir(), while nd->inode matches the state prior to that.
Normally seeing e.g. EACCES from permission check in rcu pathwalk
means that with some timings non-rcu pathwalk would've run into
the same; however, running into a non-executable regular file
in the middle of a pathname would not get to permission check -
it would fail with ENOTDIR instead.
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/affs/affs.h')
0 files changed, 0 insertions, 0 deletions