linux/fs/afs
David Howells cb78d1b5ef afs: Fix dynamic root getattr
The recent patch to make afs_getattr consult the server didn't account
for the pseudo-inodes employed by the dynamic root-type afs superblock
not having a volume or a server to access, and thus an oops occurs if
such a directory is stat'd.

Fix this by checking to see if the vnode->volume pointer actually points
anywhere before following it in afs_getattr().

This can be tested by stat'ing a directory in /afs.  It may be
sufficient just to do "ls /afs" and the oops looks something like:

        BUG: kernel NULL pointer dereference, address: 0000000000000020
        ...
        RIP: 0010:afs_getattr+0x8b/0x14b
        ...
        Call Trace:
         <TASK>
         vfs_statx+0x79/0xf5
         vfs_fstatat+0x49/0x62

Fixes: 2aeb8c86d4 ("afs: Fix afs_getattr() to refetch file status if callback break occurred")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Marc Dionne <marc.dionne@auristor.com>
Tested-by: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/165408450783.1031787.7941404776393751186.stgit@warthog.procyon.org.uk/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-06-21 11:47:30 -05:00
..
addr_list.c
afs.h
afs_cm.h
afs_fs.h
afs_vl.h
callback.c netfs: Fix gcc-12 warning by embedding vfs inode in netfs_i_context 2022-06-09 13:55:00 -07:00
cell.c
cmservice.c
dir.c netfs: Fix gcc-12 warning by embedding vfs inode in netfs_i_context 2022-06-09 13:55:00 -07:00
dir_edit.c netfs: Fix gcc-12 warning by embedding vfs inode in netfs_i_context 2022-06-09 13:55:00 -07:00
dir_silly.c netfs: Fix gcc-12 warning by embedding vfs inode in netfs_i_context 2022-06-09 13:55:00 -07:00
dynroot.c netfs: Further cleanups after struct netfs_inode wrapper introduced 2022-06-10 20:55:21 +01:00
file.c netfs: Rename the netfs_io_request cleanup op and give it an op pointer 2022-06-10 20:55:21 +01:00
flock.c
fs_operation.c netfs: Fix gcc-12 warning by embedding vfs inode in netfs_i_context 2022-06-09 13:55:00 -07:00
fs_probe.c
fsclient.c
inode.c afs: Fix dynamic root getattr 2022-06-21 11:47:30 -05:00
internal.h netfs: Further cleanups after struct netfs_inode wrapper introduced 2022-06-10 20:55:21 +01:00
Kconfig
main.c
Makefile
misc.c
mntpt.c
proc.c
protocol_afs.h
protocol_uae.h
protocol_yfs.h
rotate.c
rxrpc.c
security.c
server.c
server_list.c
super.c netfs: Fix gcc-12 warning by embedding vfs inode in netfs_i_context 2022-06-09 13:55:00 -07:00
vl_alias.c
vl_list.c
vl_probe.c
vl_rotate.c
vlclient.c
volume.c afs: Fix some checker issues 2022-06-10 20:55:21 +01:00
write.c netfs: Further cleanups after struct netfs_inode wrapper introduced 2022-06-10 20:55:21 +01:00
xattr.c
xdr_fs.h
yfsclient.c