diff options
| author | Amir Goldstein <amir73il@gmail.com> | 2026-11-06 13:01:26 +0100 |
|---|---|---|
| committer | Amir Goldstein <amir73il@gmail.com> | 2026-11-10 15:47:32 +0100 |
| commit | 7031366be218f291592a7ad38bc34a7cd1459737 (patch) | |
| tree | 9a64d5ddfbb3e923416b368d96a3321b974a8c97 /scripts/Makefile.thinlto | |
| parent | 7475ea8b58616b33c04afb976cf0fbaad9dd63fb (diff) | |
ovl: do not read the flags of a put upper dentry in lookup
ovl_lookup_layers() passes ctx->upperdentry to ovl_get_inode(), which
takes over the reference. If an overlay inode for the upper inode is
already cached, as for a second hard link, ovl_get_inode() puts the
dentry and returns the cached inode. ovl_lookup_layers() then passes
the put dentry to ovl_dentry_init_reval(), which reads its d_flags.
With a local upper fs the put dentry usually stays in the dcache, but
with a FUSE upper whose entry has timed out, dput() kills it, so this
is a use-after-free.
Fix this by taking the revalidate flags from the upper dentry of the
overlay inode, which is the one that ovl_dentry_revalidate_common()
revalidates.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-986db859-840c-479d-944c-b9c43b93377e
Fixes: bccece1ead36 ("ovl: allow remote upper")
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
