linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] possible deadlock in dquot_commit (2)
@ 2022-10-08 19:13 syzbot
  2022-10-10 22:21 ` syzbot
  2023-06-14 20:47 ` [syzbot] [ext4?] " syzbot
  0 siblings, 2 replies; 3+ messages in thread
From: syzbot @ 2022-10-08 19:13 UTC (permalink / raw)
  To: jack, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    4c86114194e6 Merge tag 'iomap-6.1-merge-1' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17fde8b2880000
kernel config:  https://syzkaller.appspot.com/x/.config?x=9905c889cc4ad738
dashboard link: https://syzkaller.appspot.com/bug?extid=70ff52e51b7e7714db8a
compiler:       Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, 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/bf7f1dcd539b/disk-4c861141.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c214481af743/vmlinux-4c861141.xz

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

loop3: detected capacity change from 0 to 4096
EXT4-fs (loop3): mounted filesystem without journal. Quota mode: writeback.
======================================================
WARNING: possible circular locking dependency detected
6.0.0-syzkaller-06475-g4c86114194e6 #0 Not tainted
------------------------------------------------------
syz-executor.3/12343 is trying to acquire lock:
ffff88802bd4bca8 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_commit+0x58/0x4e0 fs/quota/dquot.c:479

but task is already holding lock:
ffff88804c4cc8c0 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_map_blocks+0x971/0x1cc0 fs/ext4/inode.c:638

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&ei->i_data_sem/2){++++}-{3:3}:
       lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5666
       down_read+0x39/0x50 kernel/locking/rwsem.c:1499
       ext4_map_blocks+0x398/0x1cc0 fs/ext4/inode.c:568
       ext4_getblk+0x1b9/0x770 fs/ext4/inode.c:858
       ext4_bread+0x2a/0x170 fs/ext4/inode.c:914
       ext4_quota_write+0x225/0x570 fs/ext4/super.c:7087
       write_blk fs/quota/quota_tree.c:64 [inline]
       get_free_dqblk+0x357/0x6a0 fs/quota/quota_tree.c:93
       do_insert_tree+0x26c/0x1a40 fs/quota/quota_tree.c:300
       do_insert_tree+0x693/0x1a40 fs/quota/quota_tree.c:331
       do_insert_tree+0x693/0x1a40 fs/quota/quota_tree.c:331
       do_insert_tree+0x693/0x1a40 fs/quota/quota_tree.c:331
       dq_insert_tree fs/quota/quota_tree.c:357 [inline]
       qtree_write_dquot+0x3b6/0x530 fs/quota/quota_tree.c:376
       v2_write_dquot+0x11b/0x190 fs/quota/quota_v2.c:358
       dquot_acquire+0x348/0x670 fs/quota/dquot.c:444
       ext4_acquire_dquot+0x2e0/0x400 fs/ext4/super.c:6743
       dqget+0x999/0xdc0 fs/quota/dquot.c:914
       __dquot_initialize+0x291/0xcf0 fs/quota/dquot.c:1492
       ext4_process_orphan+0x57/0x2d0 fs/ext4/orphan.c:329
       ext4_orphan_cleanup+0xb60/0x1340 fs/ext4/orphan.c:474
       __ext4_fill_super fs/ext4/super.c:5520 [inline]
       ext4_fill_super+0x82e8/0x8810 fs/ext4/super.c:5648
       get_tree_bdev+0x400/0x620 fs/super.c:1323
       vfs_get_tree+0x88/0x270 fs/super.c:1530
       do_new_mount+0x289/0xad0 fs/namespace.c:3040
       do_mount fs/namespace.c:3383 [inline]
       __do_sys_mount fs/namespace.c:3591 [inline]
       __se_sys_mount+0x2d3/0x3c0 fs/namespace.c:3568
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #1 (&s->s_dquot.dqio_sem){++++}-{3:3}:
       lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5666
       down_read+0x39/0x50 kernel/locking/rwsem.c:1499
       v2_read_dquot+0x4a/0x100 fs/quota/quota_v2.c:332
       dquot_acquire+0x186/0x670 fs/quota/dquot.c:435
       ext4_acquire_dquot+0x2e0/0x400 fs/ext4/super.c:6743
       dqget+0x999/0xdc0 fs/quota/dquot.c:914
       __dquot_initialize+0x291/0xcf0 fs/quota/dquot.c:1492
       ext4_process_orphan+0x57/0x2d0 fs/ext4/orphan.c:329
       ext4_orphan_cleanup+0xb60/0x1340 fs/ext4/orphan.c:474
       __ext4_fill_super fs/ext4/super.c:5520 [inline]
       ext4_fill_super+0x82e8/0x8810 fs/ext4/super.c:5648
       get_tree_bdev+0x400/0x620 fs/super.c:1323
       vfs_get_tree+0x88/0x270 fs/super.c:1530
       do_new_mount+0x289/0xad0 fs/namespace.c:3040
       do_mount fs/namespace.c:3383 [inline]
       __do_sys_mount fs/namespace.c:3591 [inline]
       __se_sys_mount+0x2d3/0x3c0 fs/namespace.c:3568
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&dquot->dq_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3095 [inline]
       check_prevs_add kernel/locking/lockdep.c:3214 [inline]
       validate_chain+0x18c1/0x6bd0 kernel/locking/lockdep.c:3829
       __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5053
       lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5666
       __mutex_lock_common+0x1bd/0x26e0 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
       dquot_commit+0x58/0x4e0 fs/quota/dquot.c:479
       ext4_write_dquot+0x1e4/0x2b0 fs/ext4/super.c:6727
       mark_dquot_dirty fs/quota/dquot.c:346 [inline]
       mark_all_dquot_dirty fs/quota/dquot.c:384 [inline]
       __dquot_alloc_space+0xa09/0x1030 fs/quota/dquot.c:1722
       dquot_alloc_space_nodirty include/linux/quotaops.h:300 [inline]
       dquot_alloc_space include/linux/quotaops.h:313 [inline]
       dquot_alloc_block include/linux/quotaops.h:337 [inline]
       ext4_mb_new_blocks+0x106f/0x3e80 fs/ext4/mballoc.c:5573
       ext4_ext_map_blocks+0x1868/0x6880 fs/ext4/extents.c:4287
       ext4_map_blocks+0xa49/0x1cc0 fs/ext4/inode.c:645
       _ext4_get_block+0x233/0x660 fs/ext4/inode.c:802
       ext4_block_write_begin+0x6a8/0x2290 fs/ext4/inode.c:1092
       ext4_write_begin+0x5cc/0xd50
       ext4_da_write_begin+0x326/0x760 fs/ext4/inode.c:2979
       generic_perform_write+0x2a8/0x5b0 mm/filemap.c:3738
       ext4_buffered_write_iter+0x122/0x3a0 fs/ext4/file.c:285
       ext4_file_write_iter+0x1d0/0x18d0
       call_write_iter include/linux/fs.h:2188 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x7dc/0xc50 fs/read_write.c:584
       ksys_write+0x177/0x2a0 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

Chain exists of:
  &dquot->dq_lock --> &s->s_dquot.dqio_sem --> &ei->i_data_sem/2

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ei->i_data_sem/2);
                               lock(&s->s_dquot.dqio_sem);
                               lock(&ei->i_data_sem/2);
  lock(&dquot->dq_lock);

 *** DEADLOCK ***

5 locks held by syz-executor.3/12343:
 #0: ffff888020f78368 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x242/0x2e0 fs/file.c:1036
 #1: ffff88803337a460 (sb_writers#4){.+.+}-{0:0}, at: vfs_write+0x287/0xc50 fs/read_write.c:580
 #2: ffff88804c4cca38 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
 #2: ffff88804c4cca38 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_buffered_write_iter+0xae/0x3a0 fs/ext4/file.c:279
 #3: ffff88804c4cc8c0 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_map_blocks+0x971/0x1cc0 fs/ext4/inode.c:638
 #4: ffffffff8cc63528 (dquot_srcu){....}-{0:0}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:303

stack backtrace:
CPU: 1 PID: 12343 Comm: syz-executor.3 Not tainted 6.0.0-syzkaller-06475-g4c86114194e6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106
 check_noncircular+0x2cc/0x390 kernel/locking/lockdep.c:2175
 check_prev_add kernel/locking/lockdep.c:3095 [inline]
 check_prevs_add kernel/locking/lockdep.c:3214 [inline]
 validate_chain+0x18c1/0x6bd0 kernel/locking/lockdep.c:3829
 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5053
 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5666
 __mutex_lock_common+0x1bd/0x26e0 kernel/locking/mutex.c:603
 __mutex_lock kernel/locking/mutex.c:747 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
 dquot_commit+0x58/0x4e0 fs/quota/dquot.c:479
 ext4_write_dquot+0x1e4/0x2b0 fs/ext4/super.c:6727
 mark_dquot_dirty fs/quota/dquot.c:346 [inline]
 mark_all_dquot_dirty fs/quota/dquot.c:384 [inline]
 __dquot_alloc_space+0xa09/0x1030 fs/quota/dquot.c:1722
 dquot_alloc_space_nodirty include/linux/quotaops.h:300 [inline]
 dquot_alloc_space include/linux/quotaops.h:313 [inline]
 dquot_alloc_block include/linux/quotaops.h:337 [inline]
 ext4_mb_new_blocks+0x106f/0x3e80 fs/ext4/mballoc.c:5573
 ext4_ext_map_blocks+0x1868/0x6880 fs/ext4/extents.c:4287
 ext4_map_blocks+0xa49/0x1cc0 fs/ext4/inode.c:645
 _ext4_get_block+0x233/0x660 fs/ext4/inode.c:802
 ext4_block_write_begin+0x6a8/0x2290 fs/ext4/inode.c:1092
 ext4_write_begin+0x5cc/0xd50
 ext4_da_write_begin+0x326/0x760 fs/ext4/inode.c:2979
 generic_perform_write+0x2a8/0x5b0 mm/filemap.c:3738
 ext4_buffered_write_iter+0x122/0x3a0 fs/ext4/file.c:285
 ext4_file_write_iter+0x1d0/0x18d0
 call_write_iter include/linux/fs.h:2188 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x7dc/0xc50 fs/read_write.c:584
 ksys_write+0x177/0x2a0 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f54cd28a5a9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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:00007f54ce4d3168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f54cd3abf80 RCX: 00007f54cd28a5a9
RDX: 000000000208e24b RSI: 0000000020000380 RDI: 0000000000000006
RBP: 00007f54cd2e5580 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffe81cd1cbf R14: 00007f54ce4d3300 R15: 0000000000022000
 </TASK>
fuse: Bad value for 'group_id'
syz-executor.3 (12343) used greatest stack depth: 15352 bytes left


---
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.

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

* Re: [syzbot] possible deadlock in dquot_commit (2)
  2022-10-08 19:13 [syzbot] possible deadlock in dquot_commit (2) syzbot
@ 2022-10-10 22:21 ` syzbot
  2023-06-14 20:47 ` [syzbot] [ext4?] " syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2022-10-10 22:21 UTC (permalink / raw)
  To: jack, linux-kernel, syzkaller-bugs

syzbot has found a reproducer for the following issue on:

HEAD commit:    bbed346d5a96 Merge branch 'for-next/core' into for-kernelci
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=12a6f83a880000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3a4a45d2d827c1e
dashboard link: https://syzkaller.appspot.com/bug?extid=70ff52e51b7e7714db8a
compiler:       Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13002db2880000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=14fce2dc880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e8e91bc79312/disk-bbed346d.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c1cb3fb3b77e/vmlinux-bbed346d.xz
mounted in repro #1: https://storage.googleapis.com/syzbot-assets/05209e29dc74/mount_0.gz
mounted in repro #2: https://storage.googleapis.com/syzbot-assets/9644b6673e5e/mount_4.gz

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

======================================================
WARNING: possible circular locking dependency detected
6.0.0-rc7-syzkaller-18095-gbbed346d5a96 #0 Not tainted
------------------------------------------------------
syz-executor252/3082 is trying to acquire lock:
ffff0000c6c8c0a8 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_commit+0x34/0x1e4 fs/quota/dquot.c:479

but task is already holding lock:
ffff0000ca4f8c18 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_map_blocks+0x444/0xaec fs/ext4/inode.c:638

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&ei->i_data_sem/2){++++}-{3:3}:
       down_read+0x5c/0x78 kernel/locking/rwsem.c:1499
       ext4_map_blocks+0x15c/0xaec fs/ext4/inode.c:568
       ext4_getblk+0xc4/0x448 fs/ext4/inode.c:858
       ext4_bread+0x3c/0x164 fs/ext4/inode.c:914
       ext4_quota_write+0x120/0x31c fs/ext4/super.c:6956
       write_blk fs/quota/quota_tree.c:64 [inline]
       get_free_dqblk+0xec/0x1a0 fs/quota/quota_tree.c:93
       do_insert_tree+0xdc/0x838 fs/quota/quota_tree.c:300
       do_insert_tree+0x24c/0x838 fs/quota/quota_tree.c:331
       do_insert_tree+0x24c/0x838 fs/quota/quota_tree.c:331
       do_insert_tree+0x24c/0x838 fs/quota/quota_tree.c:331
       dq_insert_tree fs/quota/quota_tree.c:357 [inline]
       qtree_write_dquot+0x188/0x204 fs/quota/quota_tree.c:376
       v2_write_dquot+0x70/0xb0 fs/quota/quota_v2.c:358
       dquot_acquire+0x158/0x23c fs/quota/dquot.c:444
       ext4_acquire_dquot+0xd4/0x11c fs/ext4/super.c:6612
       dqget+0x44c/0x5c0 fs/quota/dquot.c:914
       __dquot_initialize+0x15c/0x588 fs/quota/dquot.c:1492
       dquot_initialize+0x24/0x34 fs/quota/dquot.c:1550
       ext4_create+0x50/0x26c fs/ext4/namei.c:2789
       lookup_open fs/namei.c:3413 [inline]
       open_last_lookups fs/namei.c:3481 [inline]
       path_openat+0x804/0x11c4 fs/namei.c:3688
       do_filp_open+0xdc/0x1b8 fs/namei.c:3718
       file_open_name fs/open.c:1258 [inline]
       filp_open+0x104/0x144 fs/open.c:1278
       do_coredump+0xd98/0x10a0 fs/coredump.c:697
       get_signal+0x7c4/0xb40 kernel/signal.c:2843
       do_signal+0xd4/0x438 arch/arm64/kernel/signal.c:1071
       do_notify_resume+0xc0/0x1f0 arch/arm64/kernel/signal.c:1124
       prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
       exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
       el0_da+0xb8/0x16c arch/arm64/kernel/entry-common.c:515
       el0t_64_sync_handler+0xcc/0xf0 arch/arm64/kernel/entry-common.c:657
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

-> #1 (&s->s_dquot.dqio_sem){++++}-{3:3}:
       down_read+0x5c/0x78 kernel/locking/rwsem.c:1499
       v2_read_dquot+0x28/0x64 fs/quota/quota_v2.c:332
       dquot_acquire+0x74/0x23c fs/quota/dquot.c:435
       ext4_acquire_dquot+0xd4/0x11c fs/ext4/super.c:6612
       dqget+0x44c/0x5c0 fs/quota/dquot.c:914
       __dquot_initialize+0x1b8/0x588 fs/quota/dquot.c:1492
       dquot_initialize+0x24/0x34 fs/quota/dquot.c:1550
       ext4_create+0x50/0x26c fs/ext4/namei.c:2789
       lookup_open fs/namei.c:3413 [inline]
       open_last_lookups fs/namei.c:3481 [inline]
       path_openat+0x804/0x11c4 fs/namei.c:3688
       do_filp_open+0xdc/0x1b8 fs/namei.c:3718
       file_open_name fs/open.c:1258 [inline]
       filp_open+0x104/0x144 fs/open.c:1278
       do_coredump+0xd98/0x10a0 fs/coredump.c:697
       get_signal+0x7c4/0xb40 kernel/signal.c:2843
       do_signal+0xd4/0x438 arch/arm64/kernel/signal.c:1071
       do_notify_resume+0xc0/0x1f0 arch/arm64/kernel/signal.c:1124
       prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
       exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
       el0_da+0xb8/0x16c arch/arm64/kernel/entry-common.c:515
       el0t_64_sync_handler+0xcc/0xf0 arch/arm64/kernel/entry-common.c:657
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

-> #0 (&dquot->dq_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3095 [inline]
       check_prevs_add kernel/locking/lockdep.c:3214 [inline]
       validate_chain kernel/locking/lockdep.c:3829 [inline]
       __lock_acquire+0x1530/0x30a4 kernel/locking/lockdep.c:5053
       lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5666
       __mutex_lock_common+0xd4/0xca8 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
       dquot_commit+0x34/0x1e4 fs/quota/dquot.c:479
       ext4_write_dquot fs/ext4/super.c:6596 [inline]
       ext4_mark_dquot_dirty+0xdc/0x148 fs/ext4/super.c:6644
       mark_dquot_dirty fs/quota/dquot.c:346 [inline]
       mark_all_dquot_dirty fs/quota/dquot.c:384 [inline]
       __dquot_alloc_space+0x2a8/0x644 fs/quota/dquot.c:1722
       dquot_alloc_space_nodirty include/linux/quotaops.h:300 [inline]
       dquot_alloc_space include/linux/quotaops.h:313 [inline]
       dquot_alloc_block include/linux/quotaops.h:337 [inline]
       ext4_mb_new_blocks+0x5fc/0x9e4 fs/ext4/mballoc.c:5574
       ext4_ext_map_blocks+0x7d8/0x10a0 fs/ext4/extents.c:4285
       ext4_map_blocks+0x4a8/0xaec fs/ext4/inode.c:645
       _ext4_get_block+0xb4/0x248 fs/ext4/inode.c:802
       ext4_get_block+0x4c/0x60 fs/ext4/inode.c:819
       ext4_block_write_begin+0x2d8/0x112c fs/ext4/inode.c:1092
       ext4_write_begin+0x21c/0xc38
       ext4_da_write_begin+0x1ac/0x4d0 fs/ext4/inode.c:2972
       generic_perform_write+0xf0/0x2cc mm/filemap.c:3738
       ext4_buffered_write_iter+0x15c/0x294 fs/ext4/file.c:270
       ext4_file_write_iter+0x544/0xc6c
       __kernel_write+0x128/0x2cc fs/read_write.c:523
       __dump_emit fs/coredump.c:805 [inline]
       dump_emit+0x210/0x4d4 fs/coredump.c:842
       elf_core_dump+0x111c/0x16dc fs/binfmt_elf.c:2263
       do_coredump+0x91c/0x10a0 fs/coredump.c:756
       get_signal+0x7c4/0xb40 kernel/signal.c:2843
       do_signal+0xd4/0x438 arch/arm64/kernel/signal.c:1071
       do_notify_resume+0xc0/0x1f0 arch/arm64/kernel/signal.c:1124
       prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
       exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
       el0_da+0xb8/0x16c arch/arm64/kernel/entry-common.c:515
       el0t_64_sync_handler+0xcc/0xf0 arch/arm64/kernel/entry-common.c:657
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

other info that might help us debug this:

Chain exists of:
  &dquot->dq_lock --> &s->s_dquot.dqio_sem --> &ei->i_data_sem/2

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ei->i_data_sem/2);
                               lock(&s->s_dquot.dqio_sem);
                               lock(&ei->i_data_sem/2);
  lock(&dquot->dq_lock);

 *** DEADLOCK ***

4 locks held by syz-executor252/3082:
 #0: ffff0000cd8a1460 (sb_writers#3){.+.+}-{0:0}, at: do_coredump+0x910/0x10a0 fs/coredump.c:755
 #1: ffff0000ca4f8d90 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
 #1: ffff0000ca4f8d90 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_buffered_write_iter+0x50/0x294 fs/ext4/file.c:264
 #2: ffff0000ca4f8c18 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_map_blocks+0x444/0xaec fs/ext4/inode.c:638
 #3: ffff80000d47ee98 (dquot_srcu){....}-{0:0}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:279

stack backtrace:
CPU: 0 PID: 3082 Comm: syz-executor252 Not tainted 6.0.0-rc7-syzkaller-18095-gbbed346d5a96 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/30/2022
Call trace:
 dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156
 show_stack+0x2c/0x54 arch/arm64/kernel/stacktrace.c:163
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x104/0x16c lib/dump_stack.c:106
 dump_stack+0x1c/0x58 lib/dump_stack.c:113
 print_circular_bug+0x2c4/0x2c8 kernel/locking/lockdep.c:2053
 check_noncircular+0x14c/0x154 kernel/locking/lockdep.c:2175
 check_prev_add kernel/locking/lockdep.c:3095 [inline]
 check_prevs_add kernel/locking/lockdep.c:3214 [inline]
 validate_chain kernel/locking/lockdep.c:3829 [inline]
 __lock_acquire+0x1530/0x30a4 kernel/locking/lockdep.c:5053
 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5666
 __mutex_lock_common+0xd4/0xca8 kernel/locking/mutex.c:603
 __mutex_lock kernel/locking/mutex.c:747 [inline]
 mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
 dquot_commit+0x34/0x1e4 fs/quota/dquot.c:479
 ext4_write_dquot fs/ext4/super.c:6596 [inline]
 ext4_mark_dquot_dirty+0xdc/0x148 fs/ext4/super.c:6644
 mark_dquot_dirty fs/quota/dquot.c:346 [inline]
 mark_all_dquot_dirty fs/quota/dquot.c:384 [inline]
 __dquot_alloc_space+0x2a8/0x644 fs/quota/dquot.c:1722
 dquot_alloc_space_nodirty include/linux/quotaops.h:300 [inline]
 dquot_alloc_space include/linux/quotaops.h:313 [inline]
 dquot_alloc_block include/linux/quotaops.h:337 [inline]
 ext4_mb_new_blocks+0x5fc/0x9e4 fs/ext4/mballoc.c:5574
 ext4_ext_map_blocks+0x7d8/0x10a0 fs/ext4/extents.c:4285
 ext4_map_blocks+0x4a8/0xaec fs/ext4/inode.c:645
 _ext4_get_block+0xb4/0x248 fs/ext4/inode.c:802
 ext4_get_block+0x4c/0x60 fs/ext4/inode.c:819
 ext4_block_write_begin+0x2d8/0x112c fs/ext4/inode.c:1092
 ext4_write_begin+0x21c/0xc38
 ext4_da_write_begin+0x1ac/0x4d0 fs/ext4/inode.c:2972
 generic_perform_write+0xf0/0x2cc mm/filemap.c:3738
 ext4_buffered_write_iter+0x15c/0x294 fs/ext4/file.c:270
 ext4_file_write_iter+0x544/0xc6c
 __kernel_write+0x128/0x2cc fs/read_write.c:523
 __dump_emit fs/coredump.c:805 [inline]
 dump_emit+0x210/0x4d4 fs/coredump.c:842
 elf_core_dump+0x111c/0x16dc fs/binfmt_elf.c:2263
 do_coredump+0x91c/0x10a0 fs/coredump.c:756
 get_signal+0x7c4/0xb40 kernel/signal.c:2843
 do_signal+0xd4/0x438 arch/arm64/kernel/signal.c:1071
 do_notify_resume+0xc0/0x1f0 arch/arm64/kernel/signal.c:1124
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
 el0_da+0xb8/0x16c arch/arm64/kernel/entry-common.c:515
 el0t_64_sync_handler+0xcc/0xf0 arch/arm64/kernel/entry-common.c:657
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
EXT4-fs (loop0): unmounting filesystem.


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

* Re: [syzbot] [ext4?] possible deadlock in dquot_commit (2)
  2022-10-08 19:13 [syzbot] possible deadlock in dquot_commit (2) syzbot
  2022-10-10 22:21 ` syzbot
@ 2023-06-14 20:47 ` syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2023-06-14 20:47 UTC (permalink / raw)
  To: adilger.kernel, boqun.feng, jack, linux-ext4, linux-fsdevel,
	linux-kernel, paulmck, peterz, syzkaller-bugs, tytso

syzbot suspects this issue was fixed by commit:

commit f0f44752f5f61ee4e3bd88ae033fdb888320aafe
Author: Boqun Feng <boqun.feng@gmail.com>
Date:   Fri Jan 13 06:59:54 2023 +0000

    rcu: Annotate SRCU's update-side lockdep dependencies

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1355576f280000
start commit:   ab072681eabe Merge tag 'irq_urgent_for_v6.2_rc6' of git://..
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=c8d5c2ee6c2bd4b8
dashboard link: https://syzkaller.appspot.com/bug?extid=70ff52e51b7e7714db8a
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11436221480000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15133749480000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: rcu: Annotate SRCU's update-side lockdep dependencies

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

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

end of thread, other threads:[~2023-06-14 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08 19:13 [syzbot] possible deadlock in dquot_commit (2) syzbot
2022-10-10 22:21 ` syzbot
2023-06-14 20:47 ` [syzbot] [ext4?] " 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).