linux/fs/afs
David Howells a64e4d48a0
afs: Fix afs_dynroot_readdir() to not use the RCU read lock
afs_dynroot_readdir() uses the RCU read lock to walk the cell list whilst
emitting cell automount entries - but dir_emit() may write to a userspace
buffer, thereby causing a fault to occur and waits to happen.

Fix afs_dynroot_readdir() to get a shared lock on net->cells_lock instead.

This can be triggered by enabling lockdep, preconfiguring a number of
cells, doing "mount -t afs none /afs -o dyn" (or using the kafs-client
package with afs.mount systemd unit enabled) and then doing "ls /afs".

Fixes: 1d0b929fc0 ("afs: Change dynroot to create contents on demand")
Reported-by: syzbot+3b6c5c6a1d0119b687a1@syzkaller.appspotmail.com
Reported-by: syzbot+8245611446194a52150d@syzkaller.appspotmail.com
Reported-by: syzbot+1aa62e6852a6ad1c7944@syzkaller.appspotmail.com
Reported-by: syzbot+54e6c2176ba76c56217e@syzkaller.appspotmail.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/1638014.1744145189@warthog.procyon.org.uk
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-04-11 15:24:29 +02:00
..
Kconfig
Makefile
addr_list.c afs: Use the per-peer app data provided by rxrpc 2025-03-10 09:47:15 +00:00
addr_prefs.c
afs.h
afs_cm.h
afs_fs.h
afs_vl.h
callback.c
cell.c afs: Simplify cell record handling 2025-03-10 09:47:15 +00:00
cmservice.c afs: Use the per-peer app data provided by rxrpc 2025-03-10 09:47:15 +00:00
dir.c vfs-6.15-rc1.afs 2025-03-24 13:15:16 -07:00
dir_edit.c
dir_search.c
dir_silly.c
dynroot.c afs: Fix afs_dynroot_readdir() to not use the RCU read lock 2025-04-11 15:24:29 +02:00
file.c
flock.c
fs_operation.c
fs_probe.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
fsclient.c afs: Fix afs_server ref accounting 2025-03-10 09:47:15 +00:00
inode.c
internal.h afs: Simplify cell record handling 2025-03-10 09:47:15 +00:00
main.c afs: Simplify cell record handling 2025-03-10 09:47:15 +00:00
misc.c
mntpt.c afs: Drop the net parameter from afs_unuse_cell() 2025-03-10 09:47:15 +00:00
proc.c afs: Use the per-peer app data provided by rxrpc 2025-03-10 09:47:15 +00:00
protocol_afs.h
protocol_uae.h
protocol_yfs.h
rotate.c
rxrpc.c afs: Use the per-peer app data provided by rxrpc 2025-03-10 09:47:15 +00:00
security.c
server.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
server_list.c afs: Fix afs_server ref accounting 2025-03-10 09:47:15 +00:00
super.c afs: Drop the net parameter from afs_unuse_cell() 2025-03-10 09:47:15 +00:00
validation.c
vl_alias.c afs: Drop the net parameter from afs_unuse_cell() 2025-03-10 09:47:15 +00:00
vl_list.c
vl_probe.c
vl_rotate.c afs: Simplify cell record handling 2025-03-10 09:47:15 +00:00
vlclient.c
volume.c afs: Improve afs_volume tracing to display a debug ID 2025-03-10 09:47:15 +00:00
write.c
xattr.c
xdr_fs.h
yfsclient.c