android_kernel_xiaomi_sm8450/fs/afs
David Howells 96370ba395 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-03-06 14:37:49 +00:00
..
addr_list.c afs: Use kfree_rcu() instead of casting kfree() to rcu_callback_t 2020-03-13 10:47:33 -07:00
afs_cm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
afs_fs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
afs_vl.h afs: Implement client support for the YFSVL.GetCellName RPC op 2020-06-04 15:37:57 +01:00
afs.h afs: Implement client support for the YFSVL.GetCellName RPC op 2020-06-04 15:37:57 +01:00
cache.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
callback.c afs: fix the usage of read_seqbegin_or_lock() in afs_lookup_volume_rcu() 2024-02-23 08:42:04 +01:00
cell.c afs: Fix overwriting of result of DNS query 2024-01-05 15:12:25 +01:00
cmservice.c afs: Fix tracepoint string placement with built-in AFS 2021-07-28 14:35:41 +02:00
dir_edit.c afs: Fix updating of i_blocks on file/dir extension 2021-09-30 10:11:01 +02:00
dir_silly.c afs: Fix speculative status fetches 2021-05-14 09:50:45 +02:00
dir.c afs: Fix endless loop in directory parsing 2024-03-06 14:37:49 +00:00
dynroot.c afs: Fix dynamic root lookup DNS check 2024-01-05 15:12:24 +01:00
file.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-25 09:04:07 +01:00
flock.c afs: Use the operation issue time instead of the reply time for callbacks 2022-09-15 11:32:05 +02:00
fs_operation.c afs: Fix speculative status fetches 2021-05-14 09:50:45 +02:00
fs_probe.c afs: Fix lost servers_outstanding count 2023-01-14 10:16:22 +01:00
fsclient.c afs: Use the operation issue time instead of the reply time for callbacks 2022-09-15 11:32:05 +02:00
inode.c afs: Fix updating of i_size with dv jump from server 2023-05-17 11:48:06 +02:00
internal.h afs: Fix afs_server_list to be cleaned up with RCU 2023-12-08 08:46:07 +01:00
Kconfig docs: filesystems: fix renamed references 2020-04-20 15:45:22 -06:00
main.c afs: Fix an IS_ERR() vs NULL check 2021-06-23 14:42:40 +02:00
Makefile afs: Detect cell aliases 1 - Cells with root volumes 2020-06-04 15:37:57 +01:00
misc.c afs: Return -EAGAIN, not -EREMOTEIO, when a file already locked 2022-09-23 14:17:00 +02:00
mntpt.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-25 09:04:07 +01:00
proc.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
protocol_uae.h afs: Add support for the UAE error table 2019-06-28 18:37:53 +01:00
protocol_yfs.h afs: Implement client support for the YFSVL.GetCellName RPC op 2020-06-04 15:37:57 +01:00
rotate.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
rxrpc.c afs: Fix refcount underflow from error handling race 2023-12-20 15:44:27 +01:00
security.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
server_list.c afs: Fix afs_server_list to be cleaned up with RCU 2023-12-08 08:46:07 +01:00
server.c afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*() 2024-02-23 08:42:04 +01:00
super.c afs: Fix file locking on R/O volumes to operate in local mode 2023-12-08 08:46:09 +01:00
vl_alias.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
vl_list.c afs: Don't use VL probe running state to make decisions outside probe code 2020-08-20 18:21:28 +01:00
vl_probe.c afs: Fix vlserver probe RTT handling 2023-06-21 15:45:40 +02:00
vl_rotate.c afs: Return ENOENT if no cell DNS record can be found 2023-12-08 08:46:09 +01:00
vlclient.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
volume.c afs: Increase buffer size in afs_update_volume_status() 2024-03-01 13:16:50 +01:00
write.c afs: Fix updating of i_blocks on file/dir extension 2021-09-30 10:11:01 +02:00
xattr.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-25 09:04:07 +01:00
xdr_fs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
yfsclient.c afs: Use the operation issue time instead of the reply time for callbacks 2022-09-15 11:32:05 +02:00