kernel_samsung_a53x/fs/afs
David Howells b7c9b932ca afs: Fix endless loop in directory parsing
[ Upstream commit 5f7a07646655fb4108da527565dcdc80124b14c4 ]

If a directory has a block with only ".__afsXXXX" files in it (from
uncompleted silly-rename), these .__afsXXXX files are skipped but without
advancing the file position in the dir_context.  This leads to
afs_dir_iterate() repeating the block again and again.

Fix this by making the code that skips the .__afsXXXX file also manually
advance the file position.

The symptoms are a soft lookup:

        watchdog: BUG: soft lockup - CPU#3 stuck for 52s! [check:5737]
        ...
        RIP: 0010:afs_dir_iterate_block+0x39/0x1fd
        ...
         ? watchdog_timer_fn+0x1a6/0x213
        ...
         ? asm_sysvec_apic_timer_interrupt+0x16/0x20
         ? afs_dir_iterate_block+0x39/0x1fd
         afs_dir_iterate+0x10a/0x148
         afs_readdir+0x30/0x4a
         iterate_dir+0x93/0xd3
         __do_sys_getdents64+0x6b/0xd4

This is almost certainly the actual fix for:

        https://bugzilla.kernel.org/show_bug.cgi?id=218496

Fixes: 57e9d49c5452 ("afs: Hide silly-rename files from userspace")
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/786185.1708694102@warthog.procyon.org.uk
Reviewed-by: Marc Dionne <marc.dionne@auristor.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Markus Suvanto <markus.suvanto@gmail.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 23:18:29 +01:00
..
addr_list.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
afs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
afs_cm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
afs_fs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
afs_vl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cache.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
callback.c afs: fix the usage of read_seqbegin_or_lock() in afs_lookup_volume_rcu() 2024-11-18 12:13:10 +01:00
cell.c afs: Fix overwriting of result of DNS query 2024-11-18 12:11:59 +01:00
cmservice.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dir.c afs: Fix endless loop in directory parsing 2024-11-18 23:18:29 +01:00
dir_edit.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dir_silly.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dynroot.c afs: Fix dynamic root lookup DNS check 2024-11-18 12:11:59 +01:00
file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
flock.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs_operation.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs_probe.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fsclient.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
internal.h afs: Fix afs_server_list to be cleaned up with RCU 2024-11-18 12:10:54 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
misc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mntpt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
proc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
protocol_uae.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
protocol_yfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rotate.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rxrpc.c afs: Fix refcount underflow from error handling race 2024-11-18 12:11:48 +01:00
security.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
server.c afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*() 2024-11-18 12:13:10 +01:00
server_list.c afs: Fix afs_server_list to be cleaned up with RCU 2024-11-18 12:10:54 +01:00
super.c afs: Fix file locking on R/O volumes to operate in local mode 2024-11-18 12:10:55 +01:00
vl_alias.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vl_list.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vl_probe.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vl_rotate.c afs: Return ENOENT if no cell DNS record can be found 2024-11-18 12:10:55 +01:00
vlclient.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
volume.c afs: Increase buffer size in afs_update_volume_status() 2024-11-18 22:25:41 +01:00
write.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xattr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xdr_fs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
yfsclient.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00