linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr
@ 2023-07-07  4:06 syzbot
  2023-07-10  4:13 ` syzbot
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: syzbot @ 2023-07-07  4:06 UTC (permalink / raw)
  To: chao, jaegeuk, linux-f2fs-devel, linux-fsdevel, linux-kernel,
	syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    a452483508d7 Merge tag 's390-6.5-2' of git://git.kernel.or..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=161917a0a80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=15873d91ff37a949
dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826
compiler:       Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5a4997524374/disk-a4524835.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a0d32791e67c/vmlinux-a4524835.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ff545ba23349/bzImage-a4524835.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com

F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
F2FS-fs (loop0): Found nat_bits in checkpoint
F2FS-fs (loop0): Try to recover 1th superblock, ret: 0
F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5
======================================================
WARNING: possible circular locking dependency detected
6.4.0-syzkaller-12155-ga452483508d7 #0 Not tainted
------------------------------------------------------
syz-executor.0/5180 is trying to acquire lock:
ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532

but task is already holding lock:
ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&fi->i_sem){+.+.}-{3:3}:
       down_write+0x3a/0x50 kernel/locking/rwsem.c:1573
       f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
       f2fs_add_inline_entry+0x3a8/0x760 fs/f2fs/inline.c:644
       f2fs_add_dentry+0xba/0x1e0 fs/f2fs/dir.c:784
       f2fs_do_add_link+0x21e/0x340 fs/f2fs/dir.c:827
       f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
       f2fs_create+0x32c/0x530 fs/f2fs/namei.c:377
       lookup_open fs/namei.c:3492 [inline]
       open_last_lookups fs/namei.c:3560 [inline]
       path_openat+0x13e7/0x3180 fs/namei.c:3790
       do_filp_open+0x234/0x490 fs/namei.c:3820
       do_sys_openat2+0x13e/0x1d0 fs/open.c:1407
       do_sys_open fs/open.c:1422 [inline]
       __do_sys_open fs/open.c:1430 [inline]
       __se_sys_open fs/open.c:1426 [inline]
       __x64_sys_open+0x225/0x270 fs/open.c:1426
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&fi->i_xattr_sem){.+.+}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3142 [inline]
       check_prevs_add kernel/locking/lockdep.c:3261 [inline]
       validate_chain kernel/locking/lockdep.c:3876 [inline]
       __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
       lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
       down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
       f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
       f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
       __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
       f2fs_acl_create fs/f2fs/acl.c:377 [inline]
       f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
       f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
       f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
       __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
       f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
       __f2fs_ioctl+0x1b5c/0xb770
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&fi->i_sem);
                               lock(&fi->i_xattr_sem);
                               lock(&fi->i_sem);
  rlock(&fi->i_xattr_sem);

 *** DEADLOCK ***

5 locks held by syz-executor.0/5180:
 #0: ffff888078fb2410 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write_file+0x61/0x200 fs/namespace.c:447
 #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:771 [inline]
 #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x1b2/0x9e0 fs/f2fs/file.c:2060
 #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
 #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x276/0x9e0 fs/f2fs/file.c:2074
 #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
 #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline]
 #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: __f2fs_tmpfile+0x1ce/0x380 fs/f2fs/namei.c:879
 #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
 #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838

stack backtrace:
CPU: 1 PID: 5180 Comm: syz-executor.0 Not tainted 6.4.0-syzkaller-12155-ga452483508d7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2195
 check_prev_add kernel/locking/lockdep.c:3142 [inline]
 check_prevs_add kernel/locking/lockdep.c:3261 [inline]
 validate_chain kernel/locking/lockdep.c:3876 [inline]
 __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
 down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
 f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
 f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
 __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
 f2fs_acl_create fs/f2fs/acl.c:377 [inline]
 f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
 f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
 f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
 __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
 f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
 __f2fs_ioctl+0x1b5c/0xb770
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fc9e168c389
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc9e2476168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fc9e17abf80 RCX: 00007fc9e168c389
RDX: 0000000000000000 RSI: 000000000000f501 RDI: 0000000000000005
RBP: 00007fc9e16d7493 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffcc104f8f R14: 00007fc9e2476300 R15: 0000000000022000
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr
  2023-07-07  4:06 [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr syzbot
@ 2023-07-10  4:13 ` syzbot
  2023-07-14 15:11 ` syzbot
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: syzbot @ 2023-07-10  4:13 UTC (permalink / raw)
  To: chao, jaegeuk, linux-f2fs-devel, linux-fsdevel, linux-kernel,
	syzkaller-bugs

syzbot has found a reproducer for the following issue on:

HEAD commit:    c192ac735768 MAINTAINERS 2: Electric Boogaloo
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1115adb0a80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=9831e2c2660aae77
dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=136809b4a80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1484e74ca80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/a05cca457512/disk-c192ac73.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/87f55eba1b87/vmlinux-c192ac73.xz
kernel image: https://storage.googleapis.com/syzbot-assets/81e9815bafe0/bzImage-c192ac73.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/45865ba5a074/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
6.4.0-syzkaller-12491-gc192ac735768 #0 Not tainted
------------------------------------------------------
syz-executor225/5016 is trying to acquire lock:
ffff888072747888 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
ffff888072747888 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_getxattr+0xb96/0xfd0 fs/f2fs/xattr.c:532

but task is already holding lock:
ffff88807274b668 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
ffff88807274b668 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x24/0x1d0 fs/f2fs/dir.c:838

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&fi->i_sem){+.+.}-{3:3}:
       down_write+0x92/0x200 kernel/locking/rwsem.c:1573
       f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
       f2fs_add_inline_entry+0x2c4/0x6c0 fs/f2fs/inline.c:644
       f2fs_add_dentry+0xa6/0x240 fs/f2fs/dir.c:784
       f2fs_do_add_link+0x183/0x270 fs/f2fs/dir.c:827
       f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
       f2fs_create+0x3c1/0x670 fs/f2fs/namei.c:377
       lookup_open.isra.0+0x1050/0x1400 fs/namei.c:3492
       open_last_lookups fs/namei.c:3560 [inline]
       path_openat+0x969/0x2710 fs/namei.c:3790
       do_filp_open+0x1ba/0x410 fs/namei.c:3820
       do_sys_openat2+0x160/0x1c0 fs/open.c:1407
       do_sys_open fs/open.c:1422 [inline]
       __do_sys_openat fs/open.c:1438 [inline]
       __se_sys_openat fs/open.c:1433 [inline]
       __x64_sys_openat+0x143/0x1f0 fs/open.c:1433
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&fi->i_xattr_sem){.+.+}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3142 [inline]
       check_prevs_add kernel/locking/lockdep.c:3261 [inline]
       validate_chain kernel/locking/lockdep.c:3876 [inline]
       __lock_acquire+0x2e9d/0x5e20 kernel/locking/lockdep.c:5144
       lock_acquire kernel/locking/lockdep.c:5761 [inline]
       lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5726
       down_read+0x9c/0x480 kernel/locking/rwsem.c:1520
       f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
       f2fs_getxattr+0xb96/0xfd0 fs/f2fs/xattr.c:532
       __f2fs_get_acl+0x59/0x610 fs/f2fs/acl.c:179
       f2fs_acl_create fs/f2fs/acl.c:377 [inline]
       f2fs_init_acl+0x152/0xb40 fs/f2fs/acl.c:420
       f2fs_init_inode_metadata+0x15d/0x1260 fs/f2fs/dir.c:558
       f2fs_do_tmpfile+0x33/0x1d0 fs/f2fs/dir.c:839
       __f2fs_tmpfile+0x1db/0x440 fs/f2fs/namei.c:884
       f2fs_ioc_start_atomic_write+0xcf4/0x1330 fs/f2fs/file.c:2099
       __f2fs_ioctl+0x317f/0xa5f0 fs/f2fs/file.c:4195
       f2fs_ioctl+0x194/0x220 fs/f2fs/file.c:4287
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl fs/ioctl.c:856 [inline]
       __x64_sys_ioctl+0x19d/0x210 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&fi->i_sem);
                               lock(&fi->i_xattr_sem);
                               lock(&fi->i_sem);
  rlock(&fi->i_xattr_sem);

 *** DEADLOCK ***

5 locks held by syz-executor225/5016:
 #0: ffff88807a306410 (sb_writers#10){.+.+}-{0:0}, at: f2fs_ioc_start_atomic_write+0x1a7/0x1330 fs/f2fs/file.c:2056
 #1: ffff888072749250 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:771 [inline]
 #1: ffff888072749250 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x1e3/0x1330 fs/f2fs/file.c:2060
 #2: ffff888072749830 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
 #2: ffff888072749830 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x2e6/0x1330 fs/f2fs/file.c:2074
 #3: ffff88807ba403b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
 #3: ffff88807ba403b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline]
 #3: ffff88807ba403b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: __f2fs_tmpfile+0x1ae/0x440 fs/f2fs/namei.c:879
 #4: ffff88807274b668 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
 #4: ffff88807274b668 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x24/0x1d0 fs/f2fs/dir.c:838

stack backtrace:
CPU: 1 PID: 5016 Comm: syz-executor225 Not tainted 6.4.0-syzkaller-12491-gc192ac735768 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 check_noncircular+0x2df/0x3b0 kernel/locking/lockdep.c:2195
 check_prev_add kernel/locking/lockdep.c:3142 [inline]
 check_prevs_add kernel/locking/lockdep.c:3261 [inline]
 validate_chain kernel/locking/lockdep.c:3876 [inline]
 __lock_acquire+0x2e9d/0x5e20 kernel/locking/lockdep.c:5144
 lock_acquire kernel/locking/lockdep.c:5761 [inline]
 lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5726
 down_read+0x9c/0x480 kernel/locking/rwsem.c:1520
 f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
 f2fs_getxattr+0xb96/0xfd0 fs/f2fs/xattr.c:532
 __f2fs_get_acl+0x59/0x610 fs/f2fs/acl.c:179
 f2fs_acl_create fs/f2fs/acl.c:377 [inline]
 f2fs_init_acl+0x152/0xb40 fs/f2fs/acl.c:420
 f2fs_init_inode_metadata+0x15d/0x1260 fs/f2fs/dir.c:558
 f2fs_do_tmpfile+0x33/0x1d0 fs/f2fs/dir.c:839
 __f2fs_tmpfile+0x1db/0x440 fs/f2fs/namei.c:884
 f2fs_ioc_start_atomic_write+0xcf4/0x1330 fs/f2fs/file.c:2099
 __f2fs_ioctl+0x317f/0xa5f0 fs/f2fs/file.c:4195
 f2fs_ioctl+0x194/0x220 fs/f2fs/file.c:4287
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x19d/0x210 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fe30f74c969
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc55cdfb78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe30f74c969
RDX: 0000000000000000 RSI: 000000000000f501 RDI: 0000000000000004
RBP: 00007fe30f70c200 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 00000000


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr
  2023-07-07  4:06 [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr syzbot
  2023-07-10  4:13 ` syzbot
@ 2023-07-14 15:11 ` syzbot
  2023-08-18 19:51 ` Jaegeuk Kim
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: syzbot @ 2023-07-14 15:11 UTC (permalink / raw)
  To: chao, jaegeuk, linux-f2fs-devel, linux-fsdevel, linux-kernel,
	syzkaller-bugs

syzbot has bisected this issue to:

commit 5eda1ad1aaffdfebdecf7a164e586060a210f74f
Author: Jaegeuk Kim <jaegeuk@kernel.org>
Date:   Wed Jun 28 08:00:56 2023 +0000

    f2fs: fix deadlock in i_xattr_sem and inode page lock

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1177322aa80000
start commit:   3f01e9fed845 Merge tag 'linux-watchdog-6.5-rc2' of git://w..
git tree:       upstream
final oops:     https://syzkaller.appspot.com/x/report.txt?x=1377322aa80000
console output: https://syzkaller.appspot.com/x/log.txt?x=1577322aa80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=29fd3392a08741ef
dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1336f364a80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=130a365aa80000

Reported-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com
Fixes: 5eda1ad1aaff ("f2fs: fix deadlock in i_xattr_sem and inode page lock")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr
  2023-07-07  4:06 [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr syzbot
  2023-07-10  4:13 ` syzbot
  2023-07-14 15:11 ` syzbot
@ 2023-08-18 19:51 ` Jaegeuk Kim
  2023-08-18 19:51   ` syzbot
  2023-08-18 20:15 ` Jaegeuk Kim
  2023-08-18 21:15 ` Jaegeuk Kim
  4 siblings, 1 reply; 9+ messages in thread
From: Jaegeuk Kim @ 2023-08-18 19:51 UTC (permalink / raw)
  To: syzbot; +Cc: linux-fsdevel, syzkaller-bugs, linux-kernel, linux-f2fs-devel

#syz test: github.com/jaegeuk/f2fs/tree/g-dev-test g-dev-test

On 07/06, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    a452483508d7 Merge tag 's390-6.5-2' of git://git.kernel.or..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=161917a0a80000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=15873d91ff37a949
> dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826
> compiler:       Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
> 
> Unfortunately, I don't have any reproducer for this issue yet.
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/5a4997524374/disk-a4524835.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/a0d32791e67c/vmlinux-a4524835.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/ff545ba23349/bzImage-a4524835.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com
> 
> F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
> F2FS-fs (loop0): Found nat_bits in checkpoint
> F2FS-fs (loop0): Try to recover 1th superblock, ret: 0
> F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5
> ======================================================
> WARNING: possible circular locking dependency detected
> 6.4.0-syzkaller-12155-ga452483508d7 #0 Not tainted
> ------------------------------------------------------
> syz-executor.0/5180 is trying to acquire lock:
> ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
> ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
> 
> but task is already holding lock:
> ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
> ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838
> 
> which lock already depends on the new lock.
> 
> 
> the existing dependency chain (in reverse order) is:
> 
> -> #1 (&fi->i_sem){+.+.}-{3:3}:
>        down_write+0x3a/0x50 kernel/locking/rwsem.c:1573
>        f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>        f2fs_add_inline_entry+0x3a8/0x760 fs/f2fs/inline.c:644
>        f2fs_add_dentry+0xba/0x1e0 fs/f2fs/dir.c:784
>        f2fs_do_add_link+0x21e/0x340 fs/f2fs/dir.c:827
>        f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
>        f2fs_create+0x32c/0x530 fs/f2fs/namei.c:377
>        lookup_open fs/namei.c:3492 [inline]
>        open_last_lookups fs/namei.c:3560 [inline]
>        path_openat+0x13e7/0x3180 fs/namei.c:3790
>        do_filp_open+0x234/0x490 fs/namei.c:3820
>        do_sys_openat2+0x13e/0x1d0 fs/open.c:1407
>        do_sys_open fs/open.c:1422 [inline]
>        __do_sys_open fs/open.c:1430 [inline]
>        __se_sys_open fs/open.c:1426 [inline]
>        __x64_sys_open+0x225/0x270 fs/open.c:1426
>        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>        do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>        entry_SYSCALL_64_after_hwframe+0x63/0xcd
> 
> -> #0 (&fi->i_xattr_sem){.+.+}-{3:3}:
>        check_prev_add kernel/locking/lockdep.c:3142 [inline]
>        check_prevs_add kernel/locking/lockdep.c:3261 [inline]
>        validate_chain kernel/locking/lockdep.c:3876 [inline]
>        __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
>        lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
>        down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
>        f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>        f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
>        __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
>        f2fs_acl_create fs/f2fs/acl.c:377 [inline]
>        f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
>        f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
>        f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
>        __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
>        f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
>        __f2fs_ioctl+0x1b5c/0xb770
>        vfs_ioctl fs/ioctl.c:51 [inline]
>        __do_sys_ioctl fs/ioctl.c:870 [inline]
>        __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
>        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>        do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>        entry_SYSCALL_64_after_hwframe+0x63/0xcd
> 
> other info that might help us debug this:
> 
>  Possible unsafe locking scenario:
> 
>        CPU0                    CPU1
>        ----                    ----
>   lock(&fi->i_sem);
>                                lock(&fi->i_xattr_sem);
>                                lock(&fi->i_sem);
>   rlock(&fi->i_xattr_sem);
> 
>  *** DEADLOCK ***
> 
> 5 locks held by syz-executor.0/5180:
>  #0: ffff888078fb2410 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write_file+0x61/0x200 fs/namespace.c:447
>  #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:771 [inline]
>  #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x1b2/0x9e0 fs/f2fs/file.c:2060
>  #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>  #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x276/0x9e0 fs/f2fs/file.c:2074
>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline]
>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: __f2fs_tmpfile+0x1ce/0x380 fs/f2fs/namei.c:879
>  #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>  #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838
> 
> stack backtrace:
> CPU: 1 PID: 5180 Comm: syz-executor.0 Not tainted 6.4.0-syzkaller-12155-ga452483508d7 #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
> Call Trace:
>  <TASK>
>  __dump_stack lib/dump_stack.c:88 [inline]
>  dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
>  check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2195
>  check_prev_add kernel/locking/lockdep.c:3142 [inline]
>  check_prevs_add kernel/locking/lockdep.c:3261 [inline]
>  validate_chain kernel/locking/lockdep.c:3876 [inline]
>  __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
>  lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
>  down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
>  f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>  f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
>  __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
>  f2fs_acl_create fs/f2fs/acl.c:377 [inline]
>  f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
>  f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
>  f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
>  __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
>  f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
>  __f2fs_ioctl+0x1b5c/0xb770
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>  __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x63/0xcd
> RIP: 0033:0x7fc9e168c389
> Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007fc9e2476168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007fc9e17abf80 RCX: 00007fc9e168c389
> RDX: 0000000000000000 RSI: 000000000000f501 RDI: 0000000000000005
> RBP: 00007fc9e16d7493 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> R13: 00007fffcc104f8f R14: 00007fc9e2476300 R15: 0000000000022000
>  </TASK>
> 
> 
> ---
> This report is generated by a bot. It may contain errors.
> See https://goo.gl/tpsmEJ for more information about syzbot.
> syzbot engineers can be reached at syzkaller@googlegroups.com.
> 
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> 
> If the bug is already fixed, let syzbot know by replying with:
> #syz fix: exact-commit-title
> 
> If you want to change bug's subsystems, reply with:
> #syz set subsystems: new-subsystem
> (See the list of subsystem names on the web dashboard)
> 
> If the bug is a duplicate of another bug, reply with:
> #syz dup: exact-subject-of-another-report
> 
> If you want to undo deduplication, reply with:
> #syz undup


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr
  2023-08-18 19:51 ` Jaegeuk Kim
@ 2023-08-18 19:51   ` syzbot
  0 siblings, 0 replies; 9+ messages in thread
From: syzbot @ 2023-08-18 19:51 UTC (permalink / raw)
  To: jaegeuk
  Cc: syzkaller-bugs, linux-kernel, linux-f2fs-devel, linux-fsdevel,
	jaegeuk

> #syz test: github.com/jaegeuk/f2fs/tree/g-dev-test g-dev-test

"github.com/jaegeuk/f2fs/tree/g-dev-test" does not look like a valid git repo address.

>
> On 07/06, syzbot wrote:
>> Hello,
>> 
>> syzbot found the following issue on:
>> 
>> HEAD commit:    a452483508d7 Merge tag 's390-6.5-2' of git://git.kernel.or..
>> git tree:       upstream
>> console output: https://syzkaller.appspot.com/x/log.txt?x=161917a0a80000
>> kernel config:  https://syzkaller.appspot.com/x/.config?x=15873d91ff37a949
>> dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826
>> compiler:       Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
>> 
>> Unfortunately, I don't have any reproducer for this issue yet.
>> 
>> Downloadable assets:
>> disk image: https://storage.googleapis.com/syzbot-assets/5a4997524374/disk-a4524835.raw.xz
>> vmlinux: https://storage.googleapis.com/syzbot-assets/a0d32791e67c/vmlinux-a4524835.xz
>> kernel image: https://storage.googleapis.com/syzbot-assets/ff545ba23349/bzImage-a4524835.xz
>> 
>> IMPORTANT: if you fix the issue, please add the following tag to the commit:
>> Reported-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com
>> 
>> F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
>> F2FS-fs (loop0): Found nat_bits in checkpoint
>> F2FS-fs (loop0): Try to recover 1th superblock, ret: 0
>> F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5
>> ======================================================
>> WARNING: possible circular locking dependency detected
>> 6.4.0-syzkaller-12155-ga452483508d7 #0 Not tainted
>> ------------------------------------------------------
>> syz-executor.0/5180 is trying to acquire lock:
>> ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>> ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
>> 
>> but task is already holding lock:
>> ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>> ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838
>> 
>> which lock already depends on the new lock.
>> 
>> 
>> the existing dependency chain (in reverse order) is:
>> 
>> -> #1 (&fi->i_sem){+.+.}-{3:3}:
>>        down_write+0x3a/0x50 kernel/locking/rwsem.c:1573
>>        f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>>        f2fs_add_inline_entry+0x3a8/0x760 fs/f2fs/inline.c:644
>>        f2fs_add_dentry+0xba/0x1e0 fs/f2fs/dir.c:784
>>        f2fs_do_add_link+0x21e/0x340 fs/f2fs/dir.c:827
>>        f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
>>        f2fs_create+0x32c/0x530 fs/f2fs/namei.c:377
>>        lookup_open fs/namei.c:3492 [inline]
>>        open_last_lookups fs/namei.c:3560 [inline]
>>        path_openat+0x13e7/0x3180 fs/namei.c:3790
>>        do_filp_open+0x234/0x490 fs/namei.c:3820
>>        do_sys_openat2+0x13e/0x1d0 fs/open.c:1407
>>        do_sys_open fs/open.c:1422 [inline]
>>        __do_sys_open fs/open.c:1430 [inline]
>>        __se_sys_open fs/open.c:1426 [inline]
>>        __x64_sys_open+0x225/0x270 fs/open.c:1426
>>        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>>        do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>>        entry_SYSCALL_64_after_hwframe+0x63/0xcd
>> 
>> -> #0 (&fi->i_xattr_sem){.+.+}-{3:3}:
>>        check_prev_add kernel/locking/lockdep.c:3142 [inline]
>>        check_prevs_add kernel/locking/lockdep.c:3261 [inline]
>>        validate_chain kernel/locking/lockdep.c:3876 [inline]
>>        __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
>>        lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
>>        down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
>>        f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>>        f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
>>        __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
>>        f2fs_acl_create fs/f2fs/acl.c:377 [inline]
>>        f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
>>        f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
>>        f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
>>        __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
>>        f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
>>        __f2fs_ioctl+0x1b5c/0xb770
>>        vfs_ioctl fs/ioctl.c:51 [inline]
>>        __do_sys_ioctl fs/ioctl.c:870 [inline]
>>        __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
>>        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>>        do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>>        entry_SYSCALL_64_after_hwframe+0x63/0xcd
>> 
>> other info that might help us debug this:
>> 
>>  Possible unsafe locking scenario:
>> 
>>        CPU0                    CPU1
>>        ----                    ----
>>   lock(&fi->i_sem);
>>                                lock(&fi->i_xattr_sem);
>>                                lock(&fi->i_sem);
>>   rlock(&fi->i_xattr_sem);
>> 
>>  *** DEADLOCK ***
>> 
>> 5 locks held by syz-executor.0/5180:
>>  #0: ffff888078fb2410 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write_file+0x61/0x200 fs/namespace.c:447
>>  #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:771 [inline]
>>  #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x1b2/0x9e0 fs/f2fs/file.c:2060
>>  #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>>  #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x276/0x9e0 fs/f2fs/file.c:2074
>>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline]
>>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: __f2fs_tmpfile+0x1ce/0x380 fs/f2fs/namei.c:879
>>  #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>>  #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838
>> 
>> stack backtrace:
>> CPU: 1 PID: 5180 Comm: syz-executor.0 Not tainted 6.4.0-syzkaller-12155-ga452483508d7 #0
>> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
>> Call Trace:
>>  <TASK>
>>  __dump_stack lib/dump_stack.c:88 [inline]
>>  dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
>>  check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2195
>>  check_prev_add kernel/locking/lockdep.c:3142 [inline]
>>  check_prevs_add kernel/locking/lockdep.c:3261 [inline]
>>  validate_chain kernel/locking/lockdep.c:3876 [inline]
>>  __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
>>  lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
>>  down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
>>  f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>>  f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
>>  __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
>>  f2fs_acl_create fs/f2fs/acl.c:377 [inline]
>>  f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
>>  f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
>>  f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
>>  __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
>>  f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
>>  __f2fs_ioctl+0x1b5c/0xb770
>>  vfs_ioctl fs/ioctl.c:51 [inline]
>>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>>  __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
>>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>>  do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>>  entry_SYSCALL_64_after_hwframe+0x63/0xcd
>> RIP: 0033:0x7fc9e168c389
>> Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
>> RSP: 002b:00007fc9e2476168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
>> RAX: ffffffffffffffda RBX: 00007fc9e17abf80 RCX: 00007fc9e168c389
>> RDX: 0000000000000000 RSI: 000000000000f501 RDI: 0000000000000005
>> RBP: 00007fc9e16d7493 R08: 0000000000000000 R09: 0000000000000000
>> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
>> R13: 00007fffcc104f8f R14: 00007fc9e2476300 R15: 0000000000022000
>>  </TASK>
>> 
>> 
>> ---
>> This report is generated by a bot. It may contain errors.
>> See https://goo.gl/tpsmEJ for more information about syzbot.
>> syzbot engineers can be reached at syzkaller@googlegroups.com.
>> 
>> syzbot will keep track of this issue. See:
>> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
>> 
>> If the bug is already fixed, let syzbot know by replying with:
>> #syz fix: exact-commit-title
>> 
>> If you want to change bug's subsystems, reply with:
>> #syz set subsystems: new-subsystem
>> (See the list of subsystem names on the web dashboard)
>> 
>> If the bug is a duplicate of another bug, reply with:
>> #syz dup: exact-subject-of-another-report
>> 
>> If you want to undo deduplication, reply with:
>> #syz undup


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr
  2023-07-07  4:06 [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr syzbot
                   ` (2 preceding siblings ...)
  2023-08-18 19:51 ` Jaegeuk Kim
@ 2023-08-18 20:15 ` Jaegeuk Kim
  2023-08-18 21:02   ` syzbot
  2023-08-18 21:15 ` Jaegeuk Kim
  4 siblings, 1 reply; 9+ messages in thread
From: Jaegeuk Kim @ 2023-08-18 20:15 UTC (permalink / raw)
  To: syzbot; +Cc: linux-fsdevel, syzkaller-bugs, linux-kernel, linux-f2fs-devel

#syz test: https://github.com/jaegeuk/f2fs.git g-dev-test

On 07/06, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    a452483508d7 Merge tag 's390-6.5-2' of git://git.kernel.or..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=161917a0a80000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=15873d91ff37a949
> dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826
> compiler:       Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
> 
> Unfortunately, I don't have any reproducer for this issue yet.
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/5a4997524374/disk-a4524835.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/a0d32791e67c/vmlinux-a4524835.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/ff545ba23349/bzImage-a4524835.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com
> 
> F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
> F2FS-fs (loop0): Found nat_bits in checkpoint
> F2FS-fs (loop0): Try to recover 1th superblock, ret: 0
> F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5
> ======================================================
> WARNING: possible circular locking dependency detected
> 6.4.0-syzkaller-12155-ga452483508d7 #0 Not tainted
> ------------------------------------------------------
> syz-executor.0/5180 is trying to acquire lock:
> ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
> ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
> 
> but task is already holding lock:
> ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
> ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838
> 
> which lock already depends on the new lock.
> 
> 
> the existing dependency chain (in reverse order) is:
> 
> -> #1 (&fi->i_sem){+.+.}-{3:3}:
>        down_write+0x3a/0x50 kernel/locking/rwsem.c:1573
>        f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>        f2fs_add_inline_entry+0x3a8/0x760 fs/f2fs/inline.c:644
>        f2fs_add_dentry+0xba/0x1e0 fs/f2fs/dir.c:784
>        f2fs_do_add_link+0x21e/0x340 fs/f2fs/dir.c:827
>        f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
>        f2fs_create+0x32c/0x530 fs/f2fs/namei.c:377
>        lookup_open fs/namei.c:3492 [inline]
>        open_last_lookups fs/namei.c:3560 [inline]
>        path_openat+0x13e7/0x3180 fs/namei.c:3790
>        do_filp_open+0x234/0x490 fs/namei.c:3820
>        do_sys_openat2+0x13e/0x1d0 fs/open.c:1407
>        do_sys_open fs/open.c:1422 [inline]
>        __do_sys_open fs/open.c:1430 [inline]
>        __se_sys_open fs/open.c:1426 [inline]
>        __x64_sys_open+0x225/0x270 fs/open.c:1426
>        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>        do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>        entry_SYSCALL_64_after_hwframe+0x63/0xcd
> 
> -> #0 (&fi->i_xattr_sem){.+.+}-{3:3}:
>        check_prev_add kernel/locking/lockdep.c:3142 [inline]
>        check_prevs_add kernel/locking/lockdep.c:3261 [inline]
>        validate_chain kernel/locking/lockdep.c:3876 [inline]
>        __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
>        lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
>        down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
>        f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>        f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
>        __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
>        f2fs_acl_create fs/f2fs/acl.c:377 [inline]
>        f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
>        f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
>        f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
>        __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
>        f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
>        __f2fs_ioctl+0x1b5c/0xb770
>        vfs_ioctl fs/ioctl.c:51 [inline]
>        __do_sys_ioctl fs/ioctl.c:870 [inline]
>        __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
>        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>        do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>        entry_SYSCALL_64_after_hwframe+0x63/0xcd
> 
> other info that might help us debug this:
> 
>  Possible unsafe locking scenario:
> 
>        CPU0                    CPU1
>        ----                    ----
>   lock(&fi->i_sem);
>                                lock(&fi->i_xattr_sem);
>                                lock(&fi->i_sem);
>   rlock(&fi->i_xattr_sem);
> 
>  *** DEADLOCK ***
> 
> 5 locks held by syz-executor.0/5180:
>  #0: ffff888078fb2410 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write_file+0x61/0x200 fs/namespace.c:447
>  #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:771 [inline]
>  #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x1b2/0x9e0 fs/f2fs/file.c:2060
>  #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>  #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x276/0x9e0 fs/f2fs/file.c:2074
>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline]
>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: __f2fs_tmpfile+0x1ce/0x380 fs/f2fs/namei.c:879
>  #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>  #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838
> 
> stack backtrace:
> CPU: 1 PID: 5180 Comm: syz-executor.0 Not tainted 6.4.0-syzkaller-12155-ga452483508d7 #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
> Call Trace:
>  <TASK>
>  __dump_stack lib/dump_stack.c:88 [inline]
>  dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
>  check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2195
>  check_prev_add kernel/locking/lockdep.c:3142 [inline]
>  check_prevs_add kernel/locking/lockdep.c:3261 [inline]
>  validate_chain kernel/locking/lockdep.c:3876 [inline]
>  __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
>  lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
>  down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
>  f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>  f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
>  __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
>  f2fs_acl_create fs/f2fs/acl.c:377 [inline]
>  f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
>  f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
>  f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
>  __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
>  f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
>  __f2fs_ioctl+0x1b5c/0xb770
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>  __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x63/0xcd
> RIP: 0033:0x7fc9e168c389
> Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007fc9e2476168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007fc9e17abf80 RCX: 00007fc9e168c389
> RDX: 0000000000000000 RSI: 000000000000f501 RDI: 0000000000000005
> RBP: 00007fc9e16d7493 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> R13: 00007fffcc104f8f R14: 00007fc9e2476300 R15: 0000000000022000
>  </TASK>
> 
> 
> ---
> This report is generated by a bot. It may contain errors.
> See https://goo.gl/tpsmEJ for more information about syzbot.
> syzbot engineers can be reached at syzkaller@googlegroups.com.
> 
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> 
> If the bug is already fixed, let syzbot know by replying with:
> #syz fix: exact-commit-title
> 
> If you want to change bug's subsystems, reply with:
> #syz set subsystems: new-subsystem
> (See the list of subsystem names on the web dashboard)
> 
> If the bug is a duplicate of another bug, reply with:
> #syz dup: exact-subject-of-another-report
> 
> If you want to undo deduplication, reply with:
> #syz undup


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr
  2023-08-18 20:15 ` Jaegeuk Kim
@ 2023-08-18 21:02   ` syzbot
  0 siblings, 0 replies; 9+ messages in thread
From: syzbot @ 2023-08-18 21:02 UTC (permalink / raw)
  To: chao, jaegeuk, linux-f2fs-devel, linux-fsdevel, linux-kernel,
	syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com

Tested on:

commit:         261546ae f2fs: avoid false alarm of circular locking
git tree:       https://github.com/jaegeuk/f2fs.git g-dev-test
console output: https://syzkaller.appspot.com/x/log.txt?x=16c22b3ba80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=6d0f369ef5fb88c9
dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr
  2023-07-07  4:06 [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr syzbot
                   ` (3 preceding siblings ...)
  2023-08-18 20:15 ` Jaegeuk Kim
@ 2023-08-18 21:15 ` Jaegeuk Kim
  2023-08-18 21:49   ` syzbot
  4 siblings, 1 reply; 9+ messages in thread
From: Jaegeuk Kim @ 2023-08-18 21:15 UTC (permalink / raw)
  To: syzbot; +Cc: linux-fsdevel, syzkaller-bugs, linux-kernel, linux-f2fs-devel

#syz test: https://github.com/jaegeuk/f2fs.git g-dev-test

On 07/06, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    a452483508d7 Merge tag 's390-6.5-2' of git://git.kernel.or..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=161917a0a80000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=15873d91ff37a949
> dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826
> compiler:       Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
> 
> Unfortunately, I don't have any reproducer for this issue yet.
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/5a4997524374/disk-a4524835.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/a0d32791e67c/vmlinux-a4524835.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/ff545ba23349/bzImage-a4524835.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com
> 
> F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
> F2FS-fs (loop0): Found nat_bits in checkpoint
> F2FS-fs (loop0): Try to recover 1th superblock, ret: 0
> F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5
> ======================================================
> WARNING: possible circular locking dependency detected
> 6.4.0-syzkaller-12155-ga452483508d7 #0 Not tainted
> ------------------------------------------------------
> syz-executor.0/5180 is trying to acquire lock:
> ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
> ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
> 
> but task is already holding lock:
> ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
> ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838
> 
> which lock already depends on the new lock.
> 
> 
> the existing dependency chain (in reverse order) is:
> 
> -> #1 (&fi->i_sem){+.+.}-{3:3}:
>        down_write+0x3a/0x50 kernel/locking/rwsem.c:1573
>        f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>        f2fs_add_inline_entry+0x3a8/0x760 fs/f2fs/inline.c:644
>        f2fs_add_dentry+0xba/0x1e0 fs/f2fs/dir.c:784
>        f2fs_do_add_link+0x21e/0x340 fs/f2fs/dir.c:827
>        f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
>        f2fs_create+0x32c/0x530 fs/f2fs/namei.c:377
>        lookup_open fs/namei.c:3492 [inline]
>        open_last_lookups fs/namei.c:3560 [inline]
>        path_openat+0x13e7/0x3180 fs/namei.c:3790
>        do_filp_open+0x234/0x490 fs/namei.c:3820
>        do_sys_openat2+0x13e/0x1d0 fs/open.c:1407
>        do_sys_open fs/open.c:1422 [inline]
>        __do_sys_open fs/open.c:1430 [inline]
>        __se_sys_open fs/open.c:1426 [inline]
>        __x64_sys_open+0x225/0x270 fs/open.c:1426
>        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>        do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>        entry_SYSCALL_64_after_hwframe+0x63/0xcd
> 
> -> #0 (&fi->i_xattr_sem){.+.+}-{3:3}:
>        check_prev_add kernel/locking/lockdep.c:3142 [inline]
>        check_prevs_add kernel/locking/lockdep.c:3261 [inline]
>        validate_chain kernel/locking/lockdep.c:3876 [inline]
>        __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
>        lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
>        down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
>        f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>        f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
>        __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
>        f2fs_acl_create fs/f2fs/acl.c:377 [inline]
>        f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
>        f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
>        f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
>        __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
>        f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
>        __f2fs_ioctl+0x1b5c/0xb770
>        vfs_ioctl fs/ioctl.c:51 [inline]
>        __do_sys_ioctl fs/ioctl.c:870 [inline]
>        __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
>        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>        do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>        entry_SYSCALL_64_after_hwframe+0x63/0xcd
> 
> other info that might help us debug this:
> 
>  Possible unsafe locking scenario:
> 
>        CPU0                    CPU1
>        ----                    ----
>   lock(&fi->i_sem);
>                                lock(&fi->i_xattr_sem);
>                                lock(&fi->i_sem);
>   rlock(&fi->i_xattr_sem);
> 
>  *** DEADLOCK ***
> 
> 5 locks held by syz-executor.0/5180:
>  #0: ffff888078fb2410 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write_file+0x61/0x200 fs/namespace.c:447
>  #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:771 [inline]
>  #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x1b2/0x9e0 fs/f2fs/file.c:2060
>  #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>  #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x276/0x9e0 fs/f2fs/file.c:2074
>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline]
>  #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: __f2fs_tmpfile+0x1ce/0x380 fs/f2fs/namei.c:879
>  #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
>  #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838
> 
> stack backtrace:
> CPU: 1 PID: 5180 Comm: syz-executor.0 Not tainted 6.4.0-syzkaller-12155-ga452483508d7 #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
> Call Trace:
>  <TASK>
>  __dump_stack lib/dump_stack.c:88 [inline]
>  dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
>  check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2195
>  check_prev_add kernel/locking/lockdep.c:3142 [inline]
>  check_prevs_add kernel/locking/lockdep.c:3261 [inline]
>  validate_chain kernel/locking/lockdep.c:3876 [inline]
>  __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
>  lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
>  down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
>  f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
>  f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532
>  __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179
>  f2fs_acl_create fs/f2fs/acl.c:377 [inline]
>  f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420
>  f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558
>  f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839
>  __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884
>  f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099
>  __f2fs_ioctl+0x1b5c/0xb770
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>  __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x63/0xcd
> RIP: 0033:0x7fc9e168c389
> Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007fc9e2476168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007fc9e17abf80 RCX: 00007fc9e168c389
> RDX: 0000000000000000 RSI: 000000000000f501 RDI: 0000000000000005
> RBP: 00007fc9e16d7493 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> R13: 00007fffcc104f8f R14: 00007fc9e2476300 R15: 0000000000022000
>  </TASK>
> 
> 
> ---
> This report is generated by a bot. It may contain errors.
> See https://goo.gl/tpsmEJ for more information about syzbot.
> syzbot engineers can be reached at syzkaller@googlegroups.com.
> 
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> 
> If the bug is already fixed, let syzbot know by replying with:
> #syz fix: exact-commit-title
> 
> If you want to change bug's subsystems, reply with:
> #syz set subsystems: new-subsystem
> (See the list of subsystem names on the web dashboard)
> 
> If the bug is a duplicate of another bug, reply with:
> #syz dup: exact-subject-of-another-report
> 
> If you want to undo deduplication, reply with:
> #syz undup


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr
  2023-08-18 21:15 ` Jaegeuk Kim
@ 2023-08-18 21:49   ` syzbot
  0 siblings, 0 replies; 9+ messages in thread
From: syzbot @ 2023-08-18 21:49 UTC (permalink / raw)
  To: chao, jaegeuk, linux-f2fs-devel, linux-fsdevel, linux-kernel,
	syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com

Tested on:

commit:         47e4a92b f2fs: avoid false alarm of circular locking
git tree:       https://github.com/jaegeuk/f2fs.git g-dev-test
console output: https://syzkaller.appspot.com/x/log.txt?x=16b569efa80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=6d0f369ef5fb88c9
dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-18 21:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07  4:06 [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr syzbot
2023-07-10  4:13 ` syzbot
2023-07-14 15:11 ` syzbot
2023-08-18 19:51 ` Jaegeuk Kim
2023-08-18 19:51   ` syzbot
2023-08-18 20:15 ` Jaegeuk Kim
2023-08-18 21:02   ` syzbot
2023-08-18 21:15 ` Jaegeuk Kim
2023-08-18 21:49   ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).