diff options
| author | Miklos Szeredi <mszeredi@redhat.com> | 2026-11-02 15:11:04 +0100 |
|---|---|---|
| committer | Miklos Szeredi <mszeredi@redhat.com> | 2026-11-03 17:49:49 +0100 |
| commit | 9191c2c1a76a759ac97be72481fdd4f9e920c902 (patch) | |
| tree | 7bb124f6e5e213762b70f5ffee6d9f785d8bacda /rust/kernel/alloc/allocator | |
| parent | aa0c00a516faac6683c7fb0a4f1032f471f910f7 (diff) | |
fuse: fix possible UAF in fuse_direntplus_link()
In fuse_direntplus_link() a use-after-free occurs on struct fuse_inode when
linking a newly allocated in-lookup dentry during FUSE_READDIRPLUS
processing fails inside d_splice_alias().
When d_in_lookup(dentry) is true, fuse_iget() returns an inode with an
incremented reference count and fi->nlookup, which is then passed to
d_splice_alias(). Inside d_splice_alias_ops(), if the directory inode has
an existing alias and splicing fails with -ELOOP in d_ancestor() or -ESTALE
in __d_unalias(), the function drops the alias reference via dput(new) and
unconditionally consumes the caller's inode reference via iput(inode)
before returning the error pointer.
If the existing alias is concurrently unhashed and dropped, iput(inode)
drops the final inode reference and evicts the inode immediately via
fuse_evict_inode(), sending a FUSE_FORGET request for fi->nlookup and
freeing struct fuse_inode via RCU. Because fuse_direntplus_link()
subsequently checks !IS_ERR(inode) outside an RCU read-side critical
section, it dereferences the freed inode to acquire fi->lock and decrement
fi->nlookup, and its caller parse_dirplusfile() then invokes
fuse_force_forget() on the error return, issuing a duplicate FUSE_FORGET
request to the server.
Fixes: b8bd342d50cb ("fuse: nlookup missing decrement in fuse_direntplus_link")
Cc: stable@vger.kernel.org #v6.6+
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-0a00a32c-3732-46fe-9cdb-3c67a11903cc
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'rust/kernel/alloc/allocator')
0 files changed, 0 insertions, 0 deletions
