[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2477988.1742293427@warthog.procyon.org.uk>
Date: Tue, 18 Mar 2025 10:23:47 +0000
From: David Howells <dhowells@...hat.com>
To: syzbot <syzbot+76a6f18e3af82e84f264@...kaller.appspotmail.com>
Cc: dhowells@...hat.com, enjuk@...zon.com, linux-afs@...ts.infradead.org,
linux-kernel@...r.kernel.org, marc.dionne@...istor.com,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [afs?] general protection fault in afs_atcell_get_link
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
commit 3ce74c88a6708de1842dbebc10f83013718324d0
Author: David Howells <dhowells@...hat.com>
Date: Tue Mar 18 10:18:29 2025 +0000
afs: Fix afs_atcell_get_link() to check if ws_cell is unset first
Fix afs_atcell_get_link() to check if the workstation cell is unset before
doing the RCU pathwalk bit where we dereference that.
Fixes: 823869e1e616 ("afs: Fix afs_atcell_get_link() to handle RCU pathwalk")
Reported-by: syzbot+76a6f18e3af82e84f264@...kaller.appspotmail.com
Signed-off-by: David Howells <dhowells@...hat.com>
cc: Marc Dionne <marc.dionne@...istor.com>
cc: linux-afs@...ts.infradead.org
cc: linux-fsdevel@...r.kernel.org
diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c
index 008698d706ca..7d997f7a8028 100644
--- a/fs/afs/dynroot.c
+++ b/fs/afs/dynroot.c
@@ -314,6 +314,9 @@ static const char *afs_atcell_get_link(struct dentry *dentry, struct inode *inod
const char *name;
bool dotted = vnode->fid.vnode == 3;
+ if (!rcu_access_pointer(net->ws_cell))
+ return ERR_PTR(-ENOENT);
+
if (!dentry) {
/* We're in RCU-pathwalk. */
cell = rcu_dereference(net->ws_cell);
@@ -325,9 +328,6 @@ static const char *afs_atcell_get_link(struct dentry *dentry, struct inode *inod
return name;
}
- if (!rcu_access_pointer(net->ws_cell))
- return ERR_PTR(-ENOENT);
-
down_read(&net->cells_lock);
cell = rcu_dereference_protected(net->ws_cell, lockdep_is_held(&net->cells_lock));
Powered by blists - more mailing lists