Patch "afs: Fix endless loop in directory parsing" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    afs: Fix endless loop in directory parsing

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     afs-fix-endless-loop-in-directory-parsing.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 519ae9b92f5b9be2440bd1a9c2b6f051c782f10d
Author: David Howells <dhowells@xxxxxxxxxx>
Date:   Fri Feb 23 13:15:02 2024 +0000

    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@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/786185.1708694102@xxxxxxxxxxxxxxxxxxxxxx
    Reviewed-by: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
    cc: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
    cc: Markus Suvanto <markus.suvanto@xxxxxxxxx>
    cc: linux-afs@xxxxxxxxxxxxxxxxxxx
    Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index cf811b77ee671..6e2c967fae6fc 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -478,8 +478,10 @@ static int afs_dir_iterate_block(struct afs_vnode *dvnode,
 		    dire->u.name[0] == '.' &&
 		    ctx->actor != afs_lookup_filldir &&
 		    ctx->actor != afs_lookup_one_filldir &&
-		    memcmp(dire->u.name, ".__afs", 6) == 0)
+		    memcmp(dire->u.name, ".__afs", 6) == 0) {
+			ctx->pos = blkoff + next * sizeof(union afs_xdr_dirent);
 			continue;
+		}
 
 		/* found the next entry */
 		if (!dir_emit(ctx, dire->u.name, nlen,




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux