diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-04-21 14:03:10 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-04-21 14:03:10 -0700 |
| commit | c94faa7cc414698d7c32cd43b7d02f34709a71f6 (patch) | |
| tree | d3327a69cb8e9b22e47a805603a1af7635517b40 | |
| parent | e2683c8868d03382da7e1ce8453b543a043066d1 (diff) | |
| parent | e252ed8988578f01da5a4f5aa4c2269f96f03951 (diff) | |
Merge tag 'pull-coda' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull coda dcache updates from Al Viro:
"Coda dcache-related cleanups and fixes"
* tag 'pull-coda' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
coda_flag_children(): fix a UAF
sanitize coda_dentry_delete()
coda: is_bad_inode() is always false there
| -rw-r--r-- | fs/coda/cache.c | 2 | ||||
| -rw-r--r-- | fs/coda/dir.c | 15 |
2 files changed, 5 insertions, 12 deletions
diff --git a/fs/coda/cache.c b/fs/coda/cache.c index 970f0022ec52..245131296300 100644 --- a/fs/coda/cache.c +++ b/fs/coda/cache.c @@ -93,12 +93,14 @@ static void coda_flag_children(struct dentry *parent, int flag) struct dentry *de; spin_lock(&parent->d_lock); + rcu_read_lock(); hlist_for_each_entry(de, &parent->d_children, d_sib) { struct inode *inode = d_inode_rcu(de); /* don't know what to do with negative dentries */ if (inode) coda_flag_inode(inode, flag); } + rcu_read_unlock(); spin_unlock(&parent->d_lock); } diff --git a/fs/coda/dir.c b/fs/coda/dir.c index d6b9fc3cc1ca..835eb7fdfdad 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -449,8 +449,6 @@ static int coda_dentry_revalidate(struct inode *dir, const struct qstr *name, inode = d_inode(de); if (!inode || is_root_inode(inode)) goto out; - if (is_bad_inode(inode)) - goto bad; cii = ITOC(d_inode(de)); if (!(cii->c_flags & (C_PURGE | C_FLUSH))) @@ -470,7 +468,6 @@ static int coda_dentry_revalidate(struct inode *dir, const struct qstr *name, spin_lock(&cii->c_lock); cii->c_flags &= ~(C_VATTR | C_PURGE | C_FLUSH); spin_unlock(&cii->c_lock); -bad: return 0; out: return 1; @@ -482,18 +479,12 @@ out: */ static int coda_dentry_delete(const struct dentry * dentry) { - struct inode *inode; - struct coda_inode_info *cii; + struct inode *inode = d_inode(dentry); - if (d_really_is_negative(dentry)) + if (!inode) return 0; - inode = d_inode(dentry); - if (!inode || is_bad_inode(inode)) - return 1; - - cii = ITOC(inode); - if (cii->c_flags & C_PURGE) + if (ITOC(inode)->c_flags & C_PURGE) return 1; return 0; |
