[syzbot] [f2fs?] possible deadlock in super_lock

18 views
Skip to first unread message

syzbot

unread,
Sep 3, 2023, 6:30:51 PM9/3/23
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, terr...@fb.com
Hello,

syzbot found the following issue on:

HEAD commit: 6c1b980a7e79 Merge tag 'dma-mapping-6.6-2023-08-29' of git..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13a9669fa80000
kernel config: https://syzkaller.appspot.com/x/.config?x=2212484c18930a61
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/6e2281f5cb6b/disk-6c1b980a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5fc2481dcded/vmlinux-6c1b980a.xz
kernel image: https://storage.googleapis.com/syzbot-assets/283bb76567da/bzImage-6c1b980a.xz

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

======================================================
WARNING: possible circular locking dependency detected
6.5.0-syzkaller-04808-g6c1b980a7e79 #0 Not tainted
------------------------------------------------------
syz-executor.4/22893 is trying to acquire lock:
ffff888039b740e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline]
ffff888039b740e0 (&type->s_umount_key#25){++++}-{3:3}, at: super_lock+0x23c/0x380 fs/super.c:117

but task is already holding lock:
ffff88801e60ba88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:368 [inline]
ffff88801e60ba88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x14e9/0x1ce0 block/ioctl.c:500

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&bdev->bd_holder_lock){+.+.}-{3:3}:
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747
bdev_mark_dead+0x25/0x230 block/bdev.c:961
disk_force_media_change+0x51/0x80 block/disk-events.c:303
__loop_clr_fd+0x3ab/0x8f0 drivers/block/loop.c:1174
lo_release+0x188/0x1c0 drivers/block/loop.c:1743
blkdev_put_whole+0xa5/0xe0 block/bdev.c:663
blkdev_put+0x40f/0x8e0 block/bdev.c:898
kill_block_super+0x58/0x70 fs/super.c:1623
kill_f2fs_super+0x2b7/0x3d0 fs/f2fs/super.c:4879
deactivate_locked_super+0x9a/0x170 fs/super.c:481
deactivate_super+0xde/0x100 fs/super.c:514
cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254
task_work_run+0x14d/0x240 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296
do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #1 (&disk->open_mutex){+.+.}-{3:3}:
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747
blkdev_get_by_dev.part.0+0x4f0/0xb20 block/bdev.c:786
blkdev_get_by_dev+0x75/0x80 block/bdev.c:829
journal_init_dev fs/reiserfs/journal.c:2626 [inline]
journal_init+0xbb8/0x64b0 fs/reiserfs/journal.c:2786
reiserfs_fill_super+0xcc6/0x3150 fs/reiserfs/super.c:2022
mount_bdev+0x1f3/0x2e0 fs/super.c:1603
legacy_get_tree+0x109/0x220 fs/fs_context.c:638
vfs_get_tree+0x8c/0x370 fs/super.c:1724
do_new_mount fs/namespace.c:3335 [inline]
path_mount+0x1492/0x1ed0 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:3861
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&type->s_umount_key#25){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136
lock_acquire kernel/locking/lockdep.c:5753 [inline]
lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718
down_read+0x9c/0x470 kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
super_lock+0x23c/0x380 fs/super.c:117
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1387 [inline]
fs_bdev_sync+0x94/0x1b0 fs/super.c:1422
blkdev_flushbuf block/ioctl.c:370 [inline]
blkdev_common_ioctl+0x1550/0x1ce0 block/ioctl.c:500
blkdev_ioctl+0x249/0x770 block/ioctl.c:622
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/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:
&type->s_umount_key#25 --> &disk->open_mutex --> &bdev->bd_holder_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&bdev->bd_holder_lock);
lock(&disk->open_mutex);
lock(&bdev->bd_holder_lock);
rlock(&type->s_umount_key#25);

*** DEADLOCK ***

1 lock held by syz-executor.4/22893:
#0: ffff88801e60ba88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:368 [inline]
#0: ffff88801e60ba88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x14e9/0x1ce0 block/ioctl.c:500

stack backtrace:
CPU: 1 PID: 22893 Comm: syz-executor.4 Not tainted 6.5.0-syzkaller-04808-g6c1b980a7e79 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136
lock_acquire kernel/locking/lockdep.c:5753 [inline]
lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718
down_read+0x9c/0x470 kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
super_lock+0x23c/0x380 fs/super.c:117
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1387 [inline]
fs_bdev_sync+0x94/0x1b0 fs/super.c:1422
blkdev_flushbuf block/ioctl.c:370 [inline]
blkdev_common_ioctl+0x1550/0x1ce0 block/ioctl.c:500
blkdev_ioctl+0x249/0x770 block/ioctl.c:622
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f6f9f67cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6fa03670c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f6f9f79bf80 RCX: 00007f6f9f67cae9
RDX: ffffffffffffffff RSI: 0000000000001261 RDI: 0000000000000003
RBP: 00007f6f9f6c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f6f9f79bf80 R15: 00007ffc6e219ec8
</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 syzk...@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 overwrite 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

syzbot

unread,
Sep 20, 2023, 5:13:55 AM9/20/23
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, reiserf...@vger.kernel.org, syzkall...@googlegroups.com, terr...@fb.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 2cf0f7156238 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12780282680000
kernel config: https://syzkaller.appspot.com/x/.config?x=710dc49bece494df
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107e9518680000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f48f4ed701b8/disk-2cf0f715.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5b8491e29a2d/vmlinux-2cf0f715.xz
kernel image: https://storage.googleapis.com/syzbot-assets/90faa04d6558/bzImage-2cf0f715.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/c98194587df7/mount_0.gz

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

======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc2-syzkaller-00018-g2cf0f7156238 #0 Not tainted
------------------------------------------------------
syz-executor.0/8792 is trying to acquire lock:
ffff88807993a0e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline]
ffff88807993a0e0 (&type->s_umount_key#25){++++}-{3:3}, at: super_lock+0x23c/0x380 fs/super.c:117

but task is already holding lock:
ffff888148439388 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
ffff888148439388 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x14e9/0x1ce0 block/ioctl.c:502

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&bdev->bd_holder_lock){+.+.}-{3:3}:
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747
bdev_mark_dead+0x25/0x230 block/bdev.c:961
disk_force_media_change+0x51/0x80 block/disk-events.c:303
__loop_clr_fd+0x3ab/0x8f0 drivers/block/loop.c:1174
lo_release+0x188/0x1c0 drivers/block/loop.c:1743
blkdev_put_whole+0xa5/0xe0 block/bdev.c:663
blkdev_put+0x40f/0x8e0 block/bdev.c:898
kill_block_super+0x58/0x70 fs/super.c:1649
deactivate_locked_super+0x9a/0x170 fs/super.c:481
deactivate_super+0xde/0x100 fs/super.c:514
cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254
task_work_run+0x14d/0x240 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296
do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #1 (&disk->open_mutex){+.+.}-{3:3}:
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747
blkdev_get_by_dev.part.0+0x4f0/0xb20 block/bdev.c:786
blkdev_get_by_dev+0x75/0x80 block/bdev.c:829
journal_init_dev fs/reiserfs/journal.c:2626 [inline]
journal_init+0xbb8/0x64b0 fs/reiserfs/journal.c:2786
reiserfs_fill_super+0xcc6/0x3150 fs/reiserfs/super.c:2022
mount_bdev+0x1f3/0x2e0 fs/super.c:1629
legacy_get_tree+0x109/0x220 fs/fs_context.c:638
vfs_get_tree+0x8c/0x370 fs/super.c:1750
do_new_mount fs/namespace.c:3335 [inline]
path_mount+0x1492/0x1ed0 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:3861
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&type->s_umount_key#25){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136
lock_acquire kernel/locking/lockdep.c:5753 [inline]
lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718
down_read+0x9c/0x470 kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
super_lock+0x23c/0x380 fs/super.c:117
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1431 [inline]
fs_bdev_sync+0x94/0x1b0 fs/super.c:1466
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x1550/0x1ce0 block/ioctl.c:502
blkdev_ioctl+0x249/0x770 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/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:
&type->s_umount_key#25 --> &disk->open_mutex --> &bdev->bd_holder_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&bdev->bd_holder_lock);
lock(&disk->open_mutex);
lock(&bdev->bd_holder_lock);
rlock(&type->s_umount_key#25);

*** DEADLOCK ***

1 lock held by syz-executor.0/8792:
#0: ffff888148439388 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
#0: ffff888148439388 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x14e9/0x1ce0 block/ioctl.c:502

stack backtrace:
CPU: 0 PID: 8792 Comm: syz-executor.0 Not tainted 6.6.0-rc2-syzkaller-00018-g2cf0f7156238 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136
lock_acquire kernel/locking/lockdep.c:5753 [inline]
lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718
down_read+0x9c/0x470 kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
super_lock+0x23c/0x380 fs/super.c:117
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1431 [inline]
fs_bdev_sync+0x94/0x1b0 fs/super.c:1466
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x1550/0x1ce0 block/ioctl.c:502
blkdev_ioctl+0x249/0x770 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f18ae67cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f18af4830c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f18ae79bf80 RCX: 00007f18ae67cae9
RDX: 0000000000000003 RSI: 0000000000001261 RDI: 0000000000000003
RBP: 00007f18ae6c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f18ae79bf80 R15: 00007ffc4185a478
</TASK>


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

Hillf Danton

unread,
Sep 21, 2023, 7:13:43 AM9/21/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Wed, 20 Sep 2023 02:13:53 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 2cf0f7156238 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107e9518680000

Fill super without sb locked.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2cf0f7156238

--- x/fs/super.c
+++ y/fs/super.c
@@ -1624,9 +1624,9 @@ struct dentry *mount_bdev(struct file_sy
*/
super_unlock_excl(s);
error = setup_bdev_super(s, flags, NULL);
- __super_lock_excl(s);
if (!error)
error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
+ __super_lock_excl(s);
if (error) {
deactivate_locked_super(s);
return ERR_PTR(error);
--

syzbot

unread,
Sep 21, 2023, 7:33:25 AM9/21/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
possible deadlock in super_lock

======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc2-syzkaller-00018-g2cf0f7156238-dirty #0 Not tainted
------------------------------------------------------
syz-executor.2/5807 is trying to acquire lock:
ffff88802862e0e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline]
ffff88802862e0e0 (&type->s_umount_key#25){++++}-{3:3}, at: super_lock+0x23c/0x380 fs/super.c:117

but task is already holding lock:
ffff8881484c3408 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
ffff8881484c3408 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x14e9/0x1ce0 block/ioctl.c:502

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&bdev->bd_holder_lock){+.+.}-{3:3}:
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747
bdev_mark_dead+0x25/0x230 block/bdev.c:961
disk_force_media_change+0x51/0x80 block/disk-events.c:303
__loop_clr_fd+0x3ab/0x8f0 drivers/block/loop.c:1174
lo_release+0x188/0x1c0 drivers/block/loop.c:1743
blkdev_put_whole+0xa5/0xe0 block/bdev.c:663
blkdev_put+0x40f/0x8e0 block/bdev.c:898
blkdev_release+0x82/0xa0 block/fops.c:604
__fput+0x3f7/0xa70 fs/file_table.c:384
__fput_sync+0x47/0x50 fs/file_table.c:465
__do_sys_close fs/open.c:1572 [inline]
__se_sys_close fs/open.c:1557 [inline]
__x64_sys_close+0x87/0xf0 fs/open.c:1557
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #1 (&disk->open_mutex){+.+.}-{3:3}:
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747
blkdev_put+0xb0/0x8e0 block/bdev.c:884
release_journal_dev fs/reiserfs/journal.c:2599 [inline]
free_journal_ram+0x49f/0x650 fs/reiserfs/journal.c:1896
do_journal_release fs/reiserfs/journal.c:1960 [inline]
journal_release+0x2a4/0x660 fs/reiserfs/journal.c:1971
reiserfs_put_super+0xe9/0x5c0 fs/reiserfs/super.c:616
generic_shutdown_super+0x161/0x3c0 fs/super.c:693
kill_block_super+0x3b/0x70 fs/super.c:1646
deactivate_locked_super+0x9a/0x170 fs/super.c:481
deactivate_super+0xde/0x100 fs/super.c:514
cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254
task_work_run+0x14d/0x240 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296
do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd

1 lock held by syz-executor.2/5807:
#0: ffff8881484c3408 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
#0: ffff8881484c3408 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x14e9/0x1ce0 block/ioctl.c:502

stack backtrace:
CPU: 1 PID: 5807 Comm: syz-executor.2 Not tainted 6.6.0-rc2-syzkaller-00018-g2cf0f7156238-dirty #0
RIP: 0033:0x7fb8e707cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb8e7cf50c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb8e719bf80 RCX: 00007fb8e707cae9
RDX: 0000000000000003 RSI: 0000000000001261 RDI: 0000000000000003
RBP: 00007fb8e70c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fb8e719bf80 R15: 00007ffd7864fa98
</TASK>


Tested on:

commit: 2cf0f715 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=13e90bf8680000
kernel config: https://syzkaller.appspot.com/x/.config?x=710dc49bece494df
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=177cdcf2680000

Hillf Danton

unread,
Sep 22, 2023, 8:41:47 AM9/22/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Wed, 20 Sep 2023 02:13:53 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 2cf0f7156238 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107e9518680000

Fill super without sb locked.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2cf0f7156238

--- x/fs/super.c
+++ y/fs/super.c
@@ -478,7 +478,9 @@ void deactivate_locked_super(struct supe
struct file_system_type *fs = s->s_type;
if (atomic_dec_and_test(&s->s_active)) {
unregister_shrinker(&s->s_shrink);
+ super_unlock_excl(s);
fs->kill_sb(s);
+ __super_lock_excl(s);

kill_super_notify(s);

@@ -1624,9 +1626,9 @@ struct dentry *mount_bdev(struct file_sy

syzbot

unread,
Sep 22, 2023, 9:11:17 AM9/22/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

: Allocated hash algorithm: sha256
[ 27.035992][ T1] ima: No architecture policies found
[ 27.042240][ T1] evm: Initialising EVM extended attributes:
[ 27.048580][ T1] evm: security.selinux
[ 27.052744][ T1] evm: security.SMACK64 (disabled)
[ 27.058061][ T1] evm: security.SMACK64EXEC (disabled)
[ 27.063553][ T1] evm: security.SMACK64TRANSMUTE (disabled)
[ 27.069527][ T1] evm: security.SMACK64MMAP (disabled)
[ 27.075116][ T1] evm: security.apparmor (disabled)
[ 27.080399][ T1] evm: security.ima
[ 27.084710][ T1] evm: security.capability
[ 27.090479][ T1] evm: HMAC attrs: 0x1
[ 27.097685][ T1] PM: Magic number: 7:13:29
[ 27.103531][ T1] tty ttydc: hash matches
[ 27.108483][ T1] memory memory69: hash matches
[ 27.115959][ T1] printk: console [netcon0] enabled
[ 27.121787][ T1] netconsole: network logging started
[ 27.128754][ T1] gtp: GTP module loaded (pdp ctx size 104 bytes)
[ 27.137889][ T1] rdma_rxe: loaded
[ 27.142619][ T1] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 27.155065][ T1] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 27.165314][ T1] clk: Disabling unused clocks
[ 27.165914][ T921] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 27.170274][ T1] ALSA device list:
[ 27.180256][ T921] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[ 27.184543][ T1] #0: Dummy 1
[ 27.184558][ T1] #1: Loopback 1
[ 27.184570][ T1] #2: Virtual MIDI Card 1
[ 27.212250][ T1] md: Waiting for all devices to be available before autodetect
[ 27.220507][ T1] md: If you don't use raid, use raid=noautodetect
[ 27.227162][ T1] md: Autodetecting RAID arrays.
[ 27.232319][ T1] md: autorun ...
[ 27.236020][ T1] md: ... autorun DONE.
[ 27.282766][ T1]
[ 27.285112][ T1] =====================================
[ 27.290728][ T1] WARNING: bad unlock balance detected!
[ 27.296371][ T1] 6.6.0-rc2-syzkaller-00018-g2cf0f7156238-dirty #0 Not tainted
[ 27.304445][ T1] -------------------------------------
[ 27.310421][ T1] swapper/0/1 is trying to release lock (&type->s_umount_key) at:
[ 27.318241][ T1] [<ffffffff81eb7734>] generic_shutdown_super+0x1e4/0x3c0
[ 27.325454][ T1] but there are no more locks to release!
[ 27.331175][ T1]
[ 27.331175][ T1] other info that might help us debug this:
[ 27.339755][ T1] no locks held by swapper/0/1.
[ 27.344702][ T1]
[ 27.344702][ T1] stack backtrace:
[ 27.351193][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.6.0-rc2-syzkaller-00018-g2cf0f7156238-dirty #0
[ 27.361550][ T1] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
[ 27.371784][ T1] Call Trace:
[ 27.375057][ T1] <TASK>
[ 27.377991][ T1] dump_stack_lvl+0xd9/0x1b0
[ 27.382775][ T1] lock_release+0x4b5/0x680
[ 27.387307][ T1] ? generic_shutdown_super+0x1e4/0x3c0
[ 27.393046][ T1] ? reacquire_held_locks+0x4b0/0x4b0
[ 27.399133][ T1] ? reacquire_held_locks+0x4b0/0x4b0
[ 27.404517][ T1] ? __wake_up_sync+0x20/0x20
[ 27.409379][ T1] up_write+0x2a/0x510
[ 27.413447][ T1] ? reiserfs_remount+0x1640/0x1640
[ 27.418761][ T1] generic_shutdown_super+0x1e4/0x3c0
[ 27.424293][ T1] ? reiserfs_remount+0x1640/0x1640
[ 27.429818][ T1] kill_block_super+0x3b/0x70
[ 27.434502][ T1] deactivate_locked_super+0xa6/0x180
[ 27.439882][ T1] mount_bdev+0x2a6/0x300
[ 27.444306][ T1] ? sget+0x610/0x610
[ 27.448361][ T1] ? vfs_parse_fs_param+0x3c0/0x3c0
[ 27.453617][ T1] ? cap_capable+0x1d8/0x240
[ 27.458237][ T1] ? reiserfs_kill_sb+0x1e0/0x1e0
[ 27.463792][ T1] legacy_get_tree+0x109/0x220
[ 27.468671][ T1] vfs_get_tree+0x8c/0x370
[ 27.473205][ T1] path_mount+0x1492/0x1ed0
[ 27.477749][ T1] ? kmem_cache_free+0x223/0x380
[ 27.482713][ T1] ? finish_automount+0xa40/0xa40
[ 27.487868][ T1] ? putname+0x101/0x140
[ 27.492574][ T1] init_mount+0xbf/0x110
[ 27.497105][ T1] ? nsfs_init+0xb0/0xb0
[ 27.501361][ T1] do_mount_root+0xdd/0x2c0
[ 27.506048][ T1] mount_root_generic+0x19a/0x460
[ 27.511083][ T1] ? init_rootfs+0x60/0x60
[ 27.515515][ T1] ? getname_kernel+0x21c/0x360
[ 27.520369][ T1] mount_root+0x241/0x480
[ 27.524697][ T1] ? kmem_cache_alloc+0x338/0x400
[ 27.529717][ T1] ? mount_root_generic+0x460/0x460
[ 27.535001][ T1] ? getname_kernel+0x21c/0x360
[ 27.539945][ T1] prepare_namespace+0xe3/0x3f0
[ 27.544896][ T1] ? mount_root+0x480/0x480
[ 27.549494][ T1] ? fput+0x30/0x1a0
[ 27.553394][ T1] kernel_init_freeable+0x703/0x8f0
[ 27.558596][ T1] ? rest_init+0x2b0/0x2b0
[ 27.563016][ T1] kernel_init+0x1c/0x2a0
[ 27.567351][ T1] ? rest_init+0x2b0/0x2b0
[ 27.571769][ T1] ret_from_fork+0x45/0x80
[ 27.576365][ T1] ? rest_init+0x2b0/0x2b0
[ 27.580799][ T1] ret_from_fork_asm+0x11/0x20
[ 27.585674][ T1] </TASK>
[ 27.588872][ T1] ------------[ cut here ]------------
[ 27.594557][ T1] DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): count = 0x0, magic = 0xffff88814be20070, owner = 0x0, curr 0xffff888019644040, list empty
[ 27.613588][ T1] WARNING: CPU: 0 PID: 1 at kernel/locking/rwsem.c:1369 up_write+0x458/0x510
[ 27.622528][ T1] Modules linked in:
[ 27.626442][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.6.0-rc2-syzkaller-00018-g2cf0f7156238-dirty #0
[ 27.637061][ T1] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
[ 27.648689][ T1] RIP: 0010:up_write+0x458/0x510
[ 27.653883][ T1] Code: c1 ea 03 80 3c 02 00 75 50 48 8b 13 4d 89 f1 41 55 4d 89 f8 4c 89 e1 48 c7 c6 e0 93 8c 8a 48 c7 c7 00 93 8c 8a e8 e8 e1 e6 ff <0f> 0b 5a e9 aa fc ff ff 48 89 ef e8 28 9f 75 00 e9 17 fd ff ff 48
[ 27.674317][ T1] RSP: 0000:ffffc9000027f910 EFLAGS: 00010286
[ 27.680635][ T1] RAX: 0000000000000000 RBX: ffff88814be20070 RCX: 0000000000000000
[ 27.688711][ T1] RDX: ffff888019644040 RSI: ffffffff814cf096 RDI: 0000000000000001
[ 27.696725][ T1] RBP: ffff88814be20078 R08: 0000000000000001 R09: 0000000000000000
[ 27.704906][ T1] R10: 0000000000000001 R11: 0000000000000001 R12: ffff88814be20070
[ 27.713404][ T1] R13: ffffffff8a8c9240 R14: ffff888019644040 R15: 0000000000000000
[ 27.721412][ T1] FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
[ 27.730905][ T1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 27.737626][ T1] CR2: ffff88823ffff000 CR3: 000000000c976000 CR4: 00000000003506f0
[ 27.746689][ T1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 27.754948][ T1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 27.762933][ T1] Call Trace:
[ 27.766295][ T1] <TASK>
[ 27.769274][ T1] ? show_regs+0x8f/0xa0
[ 27.773712][ T1] ? __warn+0xe6/0x380
[ 27.777946][ T1] ? up_write+0x458/0x510
[ 27.782348][ T1] ? report_bug+0x3bc/0x580
[ 27.786873][ T1] ? handle_bug+0x3c/0x70
[ 27.791192][ T1] ? exc_invalid_op+0x17/0x40
[ 27.795896][ T1] ? asm_exc_invalid_op+0x1a/0x20
[ 27.800980][ T1] ? __warn_printk+0x1a6/0x350
[ 27.805772][ T1] ? up_write+0x458/0x510
[ 27.810110][ T1] ? reiserfs_remount+0x1640/0x1640
[ 27.815343][ T1] generic_shutdown_super+0x1e4/0x3c0
[ 27.820737][ T1] ? reiserfs_remount+0x1640/0x1640
[ 27.826056][ T1] kill_block_super+0x3b/0x70
[ 27.830828][ T1] deactivate_locked_super+0xa6/0x180
[ 27.836220][ T1] mount_bdev+0x2a6/0x300
[ 27.840537][ T1] ? sget+0x610/0x610
[ 27.844534][ T1] ? vfs_parse_fs_param+0x3c0/0x3c0
[ 27.849831][ T1] ? cap_capable+0x1d8/0x240
[ 27.854439][ T1] ? reiserfs_kill_sb+0x1e0/0x1e0
[ 27.859490][ T1] legacy_get_tree+0x109/0x220
[ 27.864358][ T1] vfs_get_tree+0x8c/0x370
[ 27.868886][ T1] path_mount+0x1492/0x1ed0
[ 27.873441][ T1] ? kmem_cache_free+0x223/0x380
[ 27.878456][ T1] ? finish_automount+0xa40/0xa40
[ 27.883647][ T1] ? putname+0x101/0x140
[ 27.887917][ T1] init_mount+0xbf/0x110
[ 27.892230][ T1] ? nsfs_init+0xb0/0xb0
[ 27.896498][ T1] do_mount_root+0xdd/0x2c0
[ 27.901004][ T1] mount_root_generic+0x19a/0x460
[ 27.906042][ T1] ? init_rootfs+0x60/0x60
[ 27.910526][ T1] ? getname_kernel+0x21c/0x360
[ 27.915727][ T1] mount_root+0x241/0x480
[ 27.920314][ T1] ? kmem_cache_alloc+0x338/0x400
[ 27.925350][ T1] ? mount_root_generic+0x460/0x460
[ 27.930895][ T1] ? getname_kernel+0x21c/0x360
[ 27.936002][ T1] prepare_namespace+0xe3/0x3f0
[ 27.941118][ T1] ? mount_root+0x480/0x480
[ 27.945751][ T1] ? fput+0x30/0x1a0
[ 27.949754][ T1] kernel_init_freeable+0x703/0x8f0
[ 27.954988][ T1] ? rest_init+0x2b0/0x2b0
[ 27.959460][ T1] kernel_init+0x1c/0x2a0
[ 27.963999][ T1] ? rest_init+0x2b0/0x2b0
[ 27.969519][ T1] ret_from_fork+0x45/0x80
[ 27.974142][ T1] ? rest_init+0x2b0/0x2b0
[ 27.978650][ T1] ret_from_fork_asm+0x11/0x20
[ 27.983604][ T1] </TASK>
[ 27.986619][ T1] Kernel panic - not syncing: kernel: panic_on_warn set ...
[ 27.994750][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.6.0-rc2-syzkaller-00018-g2cf0f7156238-dirty #0
[ 28.005187][ T1] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
[ 28.015864][ T1] Call Trace:
[ 28.019651][ T1] <TASK>
[ 28.022839][ T1] dump_stack_lvl+0xd9/0x1b0
[ 28.027529][ T1] panic+0x6a6/0x750
[ 28.032304][ T1] ? panic_smp_self_stop+0xa0/0xa0
[ 28.037525][ T1] ? up_write+0x458/0x510
[ 28.042116][ T1] check_panic_on_warn+0xab/0xb0
[ 28.047062][ T1] __warn+0xf2/0x380
[ 28.050976][ T1] ? up_write+0x458/0x510
[ 28.055569][ T1] report_bug+0x3bc/0x580
[ 28.060442][ T1] handle_bug+0x3c/0x70
[ 28.065044][ T1] exc_invalid_op+0x17/0x40
[ 28.070109][ T1] asm_exc_invalid_op+0x1a/0x20
[ 28.074971][ T1] RIP: 0010:up_write+0x458/0x510
[ 28.080204][ T1] Code: c1 ea 03 80 3c 02 00 75 50 48 8b 13 4d 89 f1 41 55 4d 89 f8 4c 89 e1 48 c7 c6 e0 93 8c 8a 48 c7 c7 00 93 8c 8a e8 e8 e1 e6 ff <0f> 0b 5a e9 aa fc ff ff 48 89 ef e8 28 9f 75 00 e9 17 fd ff ff 48
[ 28.101200][ T1] RSP: 0000:ffffc9000027f910 EFLAGS: 00010286
[ 28.108760][ T1] RAX: 0000000000000000 RBX: ffff88814be20070 RCX: 0000000000000000
[ 28.117095][ T1] RDX: ffff888019644040 RSI: ffffffff814cf096 RDI: 0000000000000001
[ 28.126618][ T1] RBP: ffff88814be20078 R08: 0000000000000001 R09: 0000000000000000
[ 28.135129][ T1] R10: 0000000000000001 R11: 0000000000000001 R12: ffff88814be20070
[ 28.143194][ T1] R13: ffffffff8a8c9240 R14: ffff888019644040 R15: 0000000000000000
[ 28.151661][ T1] ? __warn_printk+0x1a6/0x350
[ 28.156636][ T1] ? reiserfs_remount+0x1640/0x1640
[ 28.162549][ T1] generic_shutdown_super+0x1e4/0x3c0
[ 28.168079][ T1] ? reiserfs_remount+0x1640/0x1640
[ 28.173469][ T1] kill_block_super+0x3b/0x70
[ 28.178141][ T1] deactivate_locked_super+0xa6/0x180
[ 28.185001][ T1] mount_bdev+0x2a6/0x300
[ 28.189343][ T1] ? sget+0x610/0x610
[ 28.193358][ T1] ? vfs_parse_fs_param+0x3c0/0x3c0
[ 28.198655][ T1] ? cap_capable+0x1d8/0x240
[ 28.203381][ T1] ? reiserfs_kill_sb+0x1e0/0x1e0
[ 28.208422][ T1] legacy_get_tree+0x109/0x220
[ 28.213330][ T1] vfs_get_tree+0x8c/0x370
[ 28.217759][ T1] path_mount+0x1492/0x1ed0
[ 28.222264][ T1] ? kmem_cache_free+0x223/0x380
[ 28.227628][ T1] ? finish_automount+0xa40/0xa40
[ 28.232783][ T1] ? putname+0x101/0x140
[ 28.237039][ T1] init_mount+0xbf/0x110
[ 28.241283][ T1] ? nsfs_init+0xb0/0xb0
[ 28.245522][ T1] do_mount_root+0xdd/0x2c0
[ 28.250046][ T1] mount_root_generic+0x19a/0x460
[ 28.255065][ T1] ? init_rootfs+0x60/0x60
[ 28.259488][ T1] ? getname_kernel+0x21c/0x360
[ 28.264366][ T1] mount_root+0x241/0x480
[ 28.268693][ T1] ? kmem_cache_alloc+0x338/0x400
[ 28.273700][ T1] ? mount_root_generic+0x460/0x460
[ 28.278888][ T1] ? getname_kernel+0x21c/0x360
[ 28.283735][ T1] prepare_namespace+0xe3/0x3f0
[ 28.288575][ T1] ? mount_root+0x480/0x480
[ 28.293225][ T1] ? fput+0x30/0x1a0
[ 28.297134][ T1] kernel_init_freeable+0x703/0x8f0
[ 28.302361][ T1] ? rest_init+0x2b0/0x2b0
[ 28.306831][ T1] kernel_init+0x1c/0x2a0
[ 28.311182][ T1] ? rest_init+0x2b0/0x2b0
[ 28.315698][ T1] ret_from_fork+0x45/0x80
[ 28.320147][ T1] ? rest_init+0x2b0/0x2b0
[ 28.324661][ T1] ret_from_fork_asm+0x11/0x20
[ 28.329423][ T1] </TASK>
[ 28.332714][ T1] Kernel Offset: disabled
[ 28.337046][ T1] Rebooting in 86400 seconds..


syzkaller build log:
go env (err=<nil>)
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/syzkaller/.cache/go-build"
GOENV="/syzkaller/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/syzkaller/jobs-2/linux/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/syzkaller/jobs-2/linux/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/syzkaller/jobs-2/linux/gopath/src/github.com/google/syzkaller/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4053167018=/tmp/go-build -gno-record-gcc-switches"

git status (err=<nil>)
HEAD detached at 0b6a67ac4
nothing to commit, working tree clean


tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Makefile:32: run command via tools/syz-env for best compatibility, see:
Makefile:33: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
go list -f '{{.Stale}}' ./sys/syz-sysgen | grep -q false || go install ./sys/syz-sysgen
make .descriptions
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
bin/syz-sysgen
touch .descriptions
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=0b6a67ac4b0dc26f43030c5edd01c9175f13b784 -X 'github.com/google/syzkaller/prog.gitRevisionDate=20230913-073137'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-fuzzer github.com/google/syzkaller/syz-fuzzer
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=0b6a67ac4b0dc26f43030c5edd01c9175f13b784 -X 'github.com/google/syzkaller/prog.gitRevisionDate=20230913-073137'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-execprog github.com/google/syzkaller/tools/syz-execprog
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=0b6a67ac4b0dc26f43030c5edd01c9175f13b784 -X 'github.com/google/syzkaller/prog.gitRevisionDate=20230913-073137'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-stress github.com/google/syzkaller/tools/syz-stress
mkdir -p ./bin/linux_amd64
gcc -o ./bin/linux_amd64/syz-executor executor/executor.cc \
-m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w -DGOOS_linux=1 -DGOARCH_amd64=1 \
-DHOSTGOOS_linux=1 -DGIT_REVISION=\"0b6a67ac4b0dc26f43030c5edd01c9175f13b784\"


Error text is too large and was truncated, full error text is at:
https://syzkaller.appspot.com/x/error.txt?x=1688a642680000


Tested on:

commit: 2cf0f715 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel config: https://syzkaller.appspot.com/x/.config?x=710dc49bece494df
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1656035a680000

Hillf Danton

unread,
Sep 22, 2023, 9:04:57 PM9/22/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Wed, 20 Sep 2023 02:13:53 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 2cf0f7156238 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107e9518680000

Fill super without sb locked.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2cf0f7156238

--- x/fs/super.c
+++ y/fs/super.c
@@ -660,6 +660,7 @@ EXPORT_SYMBOL(retire_super);
void generic_shutdown_super(struct super_block *sb)
{
const struct super_operations *sop = sb->s_op;
+ put = 0;

if (sb->s_root) {
shrink_dcache_for_umount(sb);
@@ -689,8 +690,7 @@ void generic_shutdown_super(struct super
sb->s_dio_done_wq = NULL;
}

- if (sop->put_super)
- sop->put_super(sb);
+ put = 1;

if (CHECK_DATA_CORRUPTION(!list_empty(&sb->s_inodes),
"VFS: Busy inodes after unmount of %s (%s)",
@@ -722,6 +722,10 @@ void generic_shutdown_super(struct super
*/
super_wake(sb, SB_DYING);
super_unlock_excl(sb);
+
+ if (put && sop->put_super)
+ sop->put_super(sb);
+
if (sb->s_bdi != &noop_backing_dev_info) {
if (sb->s_iflags & SB_I_PERSB_BDI)
bdi_unregister(sb->s_bdi);
@@ -1624,9 +1628,9 @@ struct dentry *mount_bdev(struct file_sy

syzbot

unread,
Sep 22, 2023, 9:14:22 PM9/22/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

fs/super.c:663:9: error: 'put' undeclared (first use in this function); did you mean 'fput'?


Tested on:

commit: 2cf0f715 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel config: https://syzkaller.appspot.com/x/.config?x=710dc49bece494df
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=14cc0642680000

Hillf Danton

unread,
Sep 22, 2023, 10:46:57 PM9/22/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Wed, 20 Sep 2023 02:13:53 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 2cf0f7156238 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107e9518680000

Fill super without sb locked.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2cf0f7156238

--- x/fs/super.c
+++ y/fs/super.c
@@ -660,6 +660,7 @@ EXPORT_SYMBOL(retire_super);
void generic_shutdown_super(struct super_block *sb)
{
const struct super_operations *sop = sb->s_op;
+ int put = 0;

syzbot

unread,
Sep 22, 2023, 11:02:20 PM9/22/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in dquot_disable

------------[ cut here ]------------
WARNING: CPU: 0 PID: 5401 at fs/quota/dquot.c:2217 dquot_disable+0xff1/0x1710 fs/quota/dquot.c:2217
Modules linked in:
CPU: 0 PID: 5401 Comm: syz-executor.0 Not tainted 6.6.0-rc2-syzkaller-00018-g2cf0f7156238-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
RIP: 0010:dquot_disable+0xff1/0x1710 fs/quota/dquot.c:2217
Code: d2 0f 85 fd 04 00 00 8b 15 48 34 c1 0c 48 c7 c6 ff ff ff ff 48 c7 c7 a0 f4 34 92 e8 19 41 46 02 e9 6f f7 ff ff e8 4f 43 7a ff <0f> 0b 48 89 ef e8 25 95 59 ff e9 a6 f0 ff ff e8 3b 43 7a ff 4c 8d
RSP: 0018:ffffc9000382fb60 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
RDX: ffff8880287c0140 RSI: ffffffff820c8201 RDI: 0000000000000005
RBP: ffff888077efc070 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888077efc000 R14: ffffffff8aa27800 R15: 1ffff92000705f79
FS: 0000555555e27480(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb752142378 CR3: 00000000212c7000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
reiserfs_quota_off+0x11f/0x160 fs/reiserfs/super.c:2480
reiserfs_quota_off_umount fs/reiserfs/super.c:581 [inline]
reiserfs_put_super+0x8f/0x5c0 fs/reiserfs/super.c:594
generic_shutdown_super+0x2ab/0x400 fs/super.c:727
kill_block_super+0x3b/0x70 fs/super.c:1650
deactivate_locked_super+0x9a/0x170 fs/super.c:481
deactivate_super+0xde/0x100 fs/super.c:514
cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254
task_work_run+0x14d/0x240 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296
do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7effb087de17
Code: b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b0 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc59c8ec28 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007effb087de17
RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffc59c8ece0
RBP: 00007ffc59c8ece0 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffc59c8fda0
R13: 00007effb08c73b9 R14: 000000000001d8a7 R15: 0000000000000005
</TASK>


Tested on:

commit: 2cf0f715 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=17d0480a680000
kernel config: https://syzkaller.appspot.com/x/.config?x=710dc49bece494df
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=11959f5c680000

Hillf Danton

unread,
Sep 23, 2023, 12:03:42 AM9/23/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Wed, 20 Sep 2023 02:13:53 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 2cf0f7156238 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107e9518680000

Fill super without sb locked.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2cf0f7156238

--- x/fs/super.c
+++ y/fs/super.c
@@ -1624,9 +1624,9 @@ struct dentry *mount_bdev(struct file_sy
*/
super_unlock_excl(s);
error = setup_bdev_super(s, flags, NULL);
- __super_lock_excl(s);
if (!error)
error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
+ __super_lock_excl(s);
if (error) {
deactivate_locked_super(s);
return ERR_PTR(error);
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -609,6 +609,7 @@ static void reiserfs_put_super(struct su
}
}

+ up_write(&s->s_umount);
/*
* note, journal_release checks for readonly mount, and can
* decide not to do a journal_end
@@ -632,6 +633,7 @@ static void reiserfs_put_super(struct su
kfree(REISERFS_SB(s)->s_jdev);
kfree(s->s_fs_info);
s->s_fs_info = NULL;
+ down_write(&s->s_umount);
}

static struct kmem_cache *reiserfs_inode_cachep;
--

syzbot

unread,
Sep 23, 2023, 12:26:28 AM9/23/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

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

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

Tested on:

commit: 2cf0f715 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=15916ee4680000
kernel config: https://syzkaller.appspot.com/x/.config?x=710dc49bece494df
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=16a02f0e680000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Oct 8, 2023, 11:14:57 AM10/8/23
to ch...@kernel.org, hda...@sina.com, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, reiserf...@vger.kernel.org, syzkall...@googlegroups.com, terr...@fb.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 19af4a4ed414 Merge branch 'for-next/core', remote-tracking..
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=1627a911680000
kernel config: https://syzkaller.appspot.com/x/.config?x=80eedef55cd21fa4
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13deb1c9680000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1006a759680000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/702d996331e0/disk-19af4a4e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2a48ce0aeb32/vmlinux-19af4a4e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/332eb4a803d2/Image-19af4a4e.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/97d89134ed25/mount_2.gz

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

======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc4-syzkaller-g19af4a4ed414 #0 Not tainted
------------------------------------------------------
syz-executor254/6025 is trying to acquire lock:
ffff0000db54a0e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline]
ffff0000db54a0e0 (&type->s_umount_key#25){++++}-{3:3}, at: super_lock+0x160/0x328 fs/super.c:117

but task is already holding lock:
ffff0000c1540c88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
ffff0000c1540c88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:502

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&bdev->bd_holder_lock){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_finish_claiming+0x218/0x3dc block/bdev.c:566
blkdev_get_by_dev+0x3f4/0x55c block/bdev.c:799
setup_bdev_super+0x68/0x51c fs/super.c:1484
mount_bdev+0x1a0/0x2b4 fs/super.c:1626
get_super_block+0x44/0x58 fs/reiserfs/super.c:2601
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1750
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
init_mount+0xe4/0x144 fs/init.c:25
do_mount_root+0x104/0x3e4 init/do_mounts.c:166
mount_root_generic+0x1f0/0x594 init/do_mounts.c:205
mount_block_root+0x6c/0x7c init/do_mounts.c:378
mount_root+0xb4/0xe4 init/do_mounts.c:405
prepare_namespace+0xdc/0x11c init/do_mounts.c:489
kernel_init_freeable+0x35c/0x474 init/main.c:1560
kernel_init+0x24/0x29c init/main.c:1437
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:857

-> #2 (bdev_lock
){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_finish_claiming+0x84/0x3dc block/bdev.c:557
blkdev_get_by_dev+0x3f4/0x55c block/bdev.c:799
setup_bdev_super+0x68/0x51c fs/super.c:1484
mount_bdev+0x1a0/0x2b4 fs/super.c:1626
get_super_block+0x44/0x58 fs/reiserfs/super.c:2601
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1750
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
init_mount+0xe4/0x144 fs/init.c:25
do_mount_root+0x104/0x3e4 init/do_mounts.c:166
mount_root_generic+0x1f0/0x594 init/do_mounts.c:205
mount_block_root+0x6c/0x7c init/do_mounts.c:378
mount_root+0xb4/0xe4 init/do_mounts.c:405
prepare_namespace+0xdc/0x11c init/do_mounts.c:489
kernel_init_freeable+0x35c/0x474 init/main.c:1560
kernel_init+0x24/0x29c init/main.c:1437
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:857

-> #1 (&disk->open_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
journal_init_dev fs/reiserfs/journal.c:2626 [inline]
journal_init+0xa60/0x1e44 fs/reiserfs/journal.c:2786
reiserfs_fill_super+0xd50/0x2028 fs/reiserfs/super.c:2022
mount_bdev+0x1e8/0x2b4 fs/super.c:1629
get_super_block+0x44/0x58 fs/reiserfs/super.c:2601
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1750
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

-> #0 (&type->s_umount_key#25){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5136
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
super_lock+0x160/0x328 fs/super.c:117
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1431 [inline]
fs_bdev_sync+0xa4/0x168 fs/super.c:1466
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:502
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

other info that might help us debug this:

Chain exists of:
&type->s_umount_key#25 --> bdev_lock --> &bdev->bd_holder_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&bdev->bd_holder_lock);
lock(bdev_lock);
lock(&bdev->bd_holder_lock);
rlock(&type->s_umount_key#25);

*** DEADLOCK ***

1 lock held by syz-executor254/6025:
#0: ffff0000c1540c88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
#0: ffff0000c1540c88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:502

stack backtrace:
CPU: 0 PID: 6025 Comm: syz-executor254 Not tainted 6.6.0-rc4-syzkaller-g19af4a4ed414 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Call trace:
dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233
show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106
dump_stack+0x1c/0x28 lib/dump_stack.c:113
print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2060
check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5136
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
super_lock+0x160/0x328 fs/super.c:117
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1431 [inline]
fs_bdev_sync+0xa4/0x168 fs/super.c:1466
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:502
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

syzbot

unread,
Oct 8, 2023, 10:05:34 PM10/8/23
to ax...@kernel.dk, bra...@kernel.org, ch...@kernel.org, daniel...@ffwll.ch, hda...@sina.com, ja...@suse.cz, jae...@kernel.org, jinpu...@ionos.com, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, maira...@riseup.net, mca...@igalia.com, reiserf...@vger.kernel.org, syzkall...@googlegroups.com, terr...@fb.com, wi...@infradead.org, yuk...@huawei.com
syzbot has bisected this issue to:

commit 7908632f2927b65f7486ae6b67c24071666ba43f
Author: Maíra Canal <mca...@igalia.com>
Date: Thu Sep 14 10:19:02 2023 +0000

Revert "drm/vkms: Fix race-condition between the hrtimer and the atomic commit"

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=17fc0565680000
start commit: 2cf0f7156238 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=14020565680000
console output: https://syzkaller.appspot.com/x/log.txt?x=10020565680000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107e9518680000

Reported-by: syzbot+062317...@syzkaller.appspotmail.com
Fixes: 7908632f2927 ("Revert "drm/vkms: Fix race-condition between the hrtimer and the atomic commit"")

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

Hillf Danton

unread,
Oct 9, 2023, 7:29:27 AM10/9/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Sun, 08 Oct 2023 08:14:54 -0700
> HEAD commit: 19af4a4ed414 Merge branch 'for-next/core', remote-tracking..
> git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1006a759680000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

--- x/block/ioctl.c
+++ y/block/ioctl.c
@@ -367,12 +367,10 @@ static int blkdev_flushbuf(struct block_
if (!capable(CAP_SYS_ADMIN))
return -EACCES;

- mutex_lock(&bdev->bd_holder_lock);
if (bdev->bd_holder_ops && bdev->bd_holder_ops->sync)
bdev->bd_holder_ops->sync(bdev);
else
sync_blockdev(bdev);
- mutex_unlock(&bdev->bd_holder_lock);

invalidate_bdev(bdev);
return 0;
--

Christian Brauner

unread,
Oct 9, 2023, 8:37:30 AM10/9/23
to syzbot, ax...@kernel.dk, ch...@kernel.org, daniel...@ffwll.ch, hda...@sina.com, ja...@suse.cz, jae...@kernel.org, jinpu...@ionos.com, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, maira...@riseup.net, mca...@igalia.com, reiserf...@vger.kernel.org, syzkall...@googlegroups.com, terr...@fb.com, wi...@infradead.org, yuk...@huawei.com
The bisect is obviously bogus. I haven't seend that bug report before
otherwise I would've already fixed this way earlier:

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git b4/vfs-fixes-reiserfs

syzbot

unread,
Oct 9, 2023, 10:01:36 AM10/9/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in fs_bdev_sync

------------[ cut here ]------------
WARNING: CPU: 0 PID: 6681 at fs/super.c:1464 fs_bdev_sync+0x138/0x168 fs/super.c:1464
Modules linked in:
CPU: 0 PID: 6681 Comm: syz-executor.4 Not tainted 6.6.0-rc5-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : fs_bdev_sync+0x138/0x168 fs/super.c:1464
lr : fs_bdev_sync+0x138/0x168 fs/super.c:1464
sp : ffff800097637a70
x29: ffff800097637a70 x28: ffff0000d6699bc0 x27: 0000000000000003
x26: dfff800000000000 x25: ffff700012ec6f58 x24: ffff800097637ac0
x23: 0000000000001261 x22: dfff800000000000 x21: 0000000000000001
x20: 0000000000000000 x19: ffff0000c657c000 x18: 0000000000000000
x17: 0000000000000000 x16: ffff80008031d534 x15: 0000000000000000
x14: 0000000000000000 x13: 0000000000000000 x12: 00000000c0101282
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
x8 : ffff0000d6699bc0 x7 : 0000000000000000 x6 : 000000000000003f
x5 : 0000000000000040 x4 : ffffffffffffffff x3 : 0000000000000000
x2 : 0000000000000015 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
fs_bdev_sync+0x138/0x168 fs/super.c:1464
blkdev_flushbuf block/ioctl.c:371 [inline]
blkdev_common_ioctl+0x838/0x286c block/ioctl.c:500
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:622
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
irq event stamp: 116
hardirqs last enabled at (115): [<ffff8000809cd760>] kasan_quarantine_put+0x1a0/0x1c8 mm/kasan/quarantine.c:240
hardirqs last disabled at (116): [<ffff80008a630728>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:436
softirqs last enabled at (92): [<ffff800080033cf4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (90): [<ffff800080033cc0>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---


Tested on:

commit: 94f6f055 Linux 6.6-rc5
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=129ec4e9680000
kernel config: https://syzkaller.appspot.com/x/.config?x=1b8c825e0d5f3f72
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=156813ee680000

syzbot

unread,
Oct 9, 2023, 10:19:42 AM10/9/23
to ax...@kernel.dk, bra...@kernel.org, ch...@kernel.org, daniel...@ffwll.ch, hda...@sina.com, ja...@suse.cz, jae...@kernel.org, jinpu...@ionos.com, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, maira...@riseup.net, mca...@igalia.com, reiserf...@vger.kernel.org, syzkall...@googlegroups.com, terr...@fb.com, wi...@infradead.org, yuk...@huawei.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: task hung in blkdev_put

INFO: task syz-executor.1:6676 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-gb6ab131813c2 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.1 state:D stack:0 pid:6676 ppid:6383 flags:0x00000005
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
blkdev_put+0xec/0x740 block/bdev.c:884
blkdev_release+0x84/0x9c block/fops.c:604
__fput+0x324/0x7f8 fs/file_table.c:384
__fput_sync+0x60/0x9c fs/file_table.c:465
__do_sys_close fs/open.c:1572 [inline]
__se_sys_close fs/open.c:1557 [inline]
__arm64_sys_close+0x150/0x1e0 fs/open.c:1557
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.2:6678 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-gb6ab131813c2 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.2 state:D stack:0 pid:6678 ppid:6377 flags:0x00000005
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
blkdev_put+0xec/0x740 block/bdev.c:884
blkdev_release+0x84/0x9c block/fops.c:604
__fput+0x324/0x7f8 fs/file_table.c:384
__fput_sync+0x60/0x9c fs/file_table.c:465
__do_sys_close fs/open.c:1572 [inline]
__se_sys_close fs/open.c:1557 [inline]
__arm64_sys_close+0x150/0x1e0 fs/open.c:1557
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.0:6682 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-gb6ab131813c2 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.0 state:D stack:0 pid:6682 ppid:6389 flags:0x0000000d
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_finish_claiming+0x218/0x3dc block/bdev.c:566
blkdev_get_by_dev+0x3f4/0x55c block/bdev.c:799
journal_init_dev fs/reiserfs/journal.c:2616 [inline]
journal_init+0xb08/0x1e68 fs/reiserfs/journal.c:2783
reiserfs_fill_super+0xd58/0x2058 fs/reiserfs/super.c:2029
mount_bdev+0x1e8/0x2b4 fs/super.c:1629
get_super_block+0x44/0x58 fs/reiserfs/super.c:2605
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1750
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.3:6690 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-gb6ab131813c2 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.3 state:D stack:0 pid:6690 ppid:6373 flags:0x0000000d
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
super_lock+0x23c/0x328 fs/super.c:134
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1431 [inline]
fs_bdev_sync+0xa4/0x168 fs/super.c:1466
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:502
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.3:6695 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-gb6ab131813c2 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.3 state:D stack:0 pid:6695 ppid:6373 flags:0x00000005
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
loop_configure+0x15c/0xfd4 drivers/block/loop.c:1018
lo_ioctl+0xc70/0x1d04
blkdev_ioctl+0x3e4/0xae4 block/ioctl.c:630
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.5:6696 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-gb6ab131813c2 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.5 state:D stack:0 pid:6696 ppid:6381 flags:0x00000005
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
blkdev_open+0x128/0x2b0 block/fops.c:589
do_dentry_open+0x6fc/0x118c fs/open.c:929
vfs_open+0x7c/0x90 fs/open.c:1063
do_open fs/namei.c:3639 [inline]
path_openat+0x1f2c/0x27f8 fs/namei.c:3796
do_filp_open+0x1bc/0x3cc fs/namei.c:3823
do_sys_openat2+0x124/0x1b8 fs/open.c:1422
do_sys_open fs/open.c:1437 [inline]
__do_sys_openat fs/open.c:1453 [inline]
__se_sys_openat fs/open.c:1448 [inline]
__arm64_sys_openat+0x1f0/0x240 fs/open.c:1448
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.5:6703 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-gb6ab131813c2 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.5 state:D stack:0 pid:6703 ppid:6381 flags:0x00000005
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
loop_configure+0x15c/0xfd4 drivers/block/loop.c:1018
lo_ioctl+0xc70/0x1d04
blkdev_ioctl+0x3e4/0xae4 block/ioctl.c:630
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.4:6698 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-gb6ab131813c2 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.4 state:D stack:0 pid:6698 ppid:6384 flags:0x00000005
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
blkdev_open+0x128/0x2b0 block/fops.c:589
do_dentry_open+0x6fc/0x118c fs/open.c:929
vfs_open+0x7c/0x90 fs/open.c:1063
do_open fs/namei.c:3639 [inline]
path_openat+0x1f2c/0x27f8 fs/namei.c:3796
do_filp_open+0x1bc/0x3cc fs/namei.c:3823
do_sys_openat2+0x124/0x1b8 fs/open.c:1422
do_sys_open fs/open.c:1437 [inline]
__do_sys_openat fs/open.c:1453 [inline]
__se_sys_openat fs/open.c:1448 [inline]
__arm64_sys_openat+0x1f0/0x240 fs/open.c:1448
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.4:6704 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-gb6ab131813c2 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.4 state:D stack:0 pid:6704 ppid:6384 flags:0x00000005
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
loop_configure+0x15c/0xfd4 drivers/block/loop.c:1018
lo_ioctl+0xc70/0x1d04
blkdev_ioctl+0x3e4/0xae4 block/ioctl.c:630
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

Showing all locks held in the system:
1 lock held by khungtaskd/30:
#0: ffff80008e3739c0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0xc/0x44 include/linux/rcupdate.h:302
2 locks held by kworker/u4:6/235:
2 locks held by getty/5770:
#0: ffff0000d6cf20a0 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x3c/0x4c drivers/tty/tty_ldsem.c:340
#1: ffff8000959f02f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x414/0x1214 drivers/tty/n_tty.c:2206
1 lock held by syz-executor.1/6676:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xec/0x740 block/bdev.c:884
1 lock held by syz-executor.2/6678:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xec/0x740 block/bdev.c:884
3 locks held by syz-executor.0/6682:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
#1: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_finish_claiming+0x84/0x3dc block/bdev.c:557
#2: ffff0000c1543a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: bd_finish_claiming+0x218/0x3dc block/bdev.c:566
1 lock held by syz-executor.3/6690:
#0: ffff0000c1543a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
#0: ffff0000c1543a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:502
1 lock held by syz-executor.3/6695:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.5/6696:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.5/6703:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.4/6698:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.4/6704:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.0/6872:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.1/6939:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.1/6940:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.2/6956:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.2/6957:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.5/6959:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.5/6960:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.3/6976:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.3/6977:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.4/6979:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.4/6980:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.1/6999:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.1/7000:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.2/7054:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.2/7055:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.5/7067:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.5/7068:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.3/7075:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.3/7078:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.4/7083:
#0: ffff0000c9ce34c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.4/7084:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508

=============================================



Tested on:

commit: b6ab1318 reiserfs: fix journal device opening
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git b4/vfs-fixes-reiserfs
console output: https://syzkaller.appspot.com/x/log.txt?x=125bdcde680000
kernel config: https://syzkaller.appspot.com/x/.config?x=1b8c825e0d5f3f72
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

Note: no patches were applied.

syzbot

unread,
Oct 10, 2023, 5:21:00 AM10/10/23
to bra...@kernel.org, bra...@kernel.org, syzkall...@googlegroups.com
Your commands are accepted, but please keep syzkall...@googlegroups.com mailing list in CC next time. It serves as a history of what happened with each bug report. Thank you.

syzbot

unread,
Oct 10, 2023, 6:02:29 AM10/10/23
to bra...@kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: task hung in blkdev_put

INFO: task syz-executor.3:6371 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-00005-g88500e4e46f7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.3 state:D stack:0 pid:6371 ppid:1 flags:0x0000000d
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_end_claim block/bdev.c:600 [inline]
blkdev_put+0x130/0x740 block/bdev.c:886
kill_block_super+0x5c/0x74 fs/super.c:1649
reiserfs_kill_sb+0xfc/0x160 fs/reiserfs/super.c:574
deactivate_locked_super+0xac/0x12c fs/super.c:481
deactivate_super+0xe0/0x100 fs/super.c:514
cleanup_mnt+0x34c/0x3dc fs/namespace.c:1254
__cleanup_mnt+0x20/0x30 fs/namespace.c:1261
task_work_run+0x230/0x2e0 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x2184/0x3c94 arch/arm64/kernel/signal.c:1305
exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:144 [inline]
el0_svc+0xa0/0x16c arch/arm64/kernel/entry-common.c:679
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task udevd:6398 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-00005-g88500e4e46f7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:udevd state:D stack:0 pid:6398 ppid:5627 flags:0x00000004
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
blkdev_put+0xec/0x740 block/bdev.c:884
blkdev_release+0x84/0x9c block/fops.c:604
__fput+0x324/0x7f8 fs/file_table.c:384
__fput_sync+0x60/0x9c fs/file_table.c:465
__do_sys_close fs/open.c:1572 [inline]
__se_sys_close fs/open.c:1557 [inline]
__arm64_sys_close+0x150/0x1e0 fs/open.c:1557
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.0:6660 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-00005-g88500e4e46f7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.0 state:D stack:0 pid:6660 ppid:6379 flags:0x0000000d
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_finish_claiming+0x218/0x3dc block/bdev.c:566
blkdev_get_by_dev+0x3f4/0x55c block/bdev.c:799
journal_init_dev fs/reiserfs/journal.c:2622 [inline]
journal_init+0xa64/0x1e48 fs/reiserfs/journal.c:2788
reiserfs_fill_super+0xd58/0x2058 fs/reiserfs/super.c:2029
mount_bdev+0x1e8/0x2b4 fs/super.c:1629
get_super_block+0x44/0x58 fs/reiserfs/super.c:2605
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1750
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.5:6662 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-00005-g88500e4e46f7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.5 state:D stack:0 pid:6662 ppid:6381 flags:0x0000000d
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
blkdev_get_by_dev+0xb4/0x55c block/bdev.c:774
journal_init_dev fs/reiserfs/journal.c:2622 [inline]
journal_init+0xa64/0x1e48 fs/reiserfs/journal.c:2788
reiserfs_fill_super+0xd58/0x2058 fs/reiserfs/super.c:2029
mount_bdev+0x1e8/0x2b4 fs/super.c:1629
get_super_block+0x44/0x58 fs/reiserfs/super.c:2605
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1750
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.1:6666 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-00005-g88500e4e46f7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.1 state:D stack:0 pid:6666 ppid:6380 flags:0x0000000d
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
blkdev_get_by_dev+0xb4/0x55c block/bdev.c:774
journal_init_dev fs/reiserfs/journal.c:2622 [inline]
journal_init+0xa64/0x1e48 fs/reiserfs/journal.c:2788
reiserfs_fill_super+0xd58/0x2058 fs/reiserfs/super.c:2029
mount_bdev+0x1e8/0x2b4 fs/super.c:1629
get_super_block+0x44/0x58 fs/reiserfs/super.c:2605
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1750
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.2:6675 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-00005-g88500e4e46f7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.2 state:D stack:0 pid:6675 ppid:6388 flags:0x0000000d
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
blkdev_get_by_dev+0xb4/0x55c block/bdev.c:774
journal_init_dev fs/reiserfs/journal.c:2622 [inline]
journal_init+0xa64/0x1e48 fs/reiserfs/journal.c:2788
reiserfs_fill_super+0xd58/0x2058 fs/reiserfs/super.c:2029
mount_bdev+0x1e8/0x2b4 fs/super.c:1629
get_super_block+0x44/0x58 fs/reiserfs/super.c:2605
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1750
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.4:6678 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-00005-g88500e4e46f7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.4 state:D stack:0 pid:6678 ppid:6383 flags:0x0000000d
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
super_lock+0x23c/0x328 fs/super.c:134
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1431 [inline]
fs_bdev_sync+0xa4/0x168 fs/super.c:1466
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:502
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
INFO: task syz-executor.4:6681 blocked for more than 143 seconds.
Not tainted 6.6.0-rc5-syzkaller-00005-g88500e4e46f7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.4 state:D stack:0 pid:6681 ppid:6383 flags:0x00000005
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:556
context_switch kernel/sched/core.c:5382 [inline]
__schedule+0x1364/0x23b4 kernel/sched/core.c:6695
schedule+0xc4/0x170 kernel/sched/core.c:6771
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6830
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
loop_configure+0x15c/0xfd4 drivers/block/loop.c:1018
lo_ioctl+0xc70/0x1d04
blkdev_ioctl+0x3e4/0xae4 block/ioctl.c:630
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

Showing all locks held in the system:
1 lock held by khungtaskd/29:
#0: ffff80008e3739c0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0xc/0x44 include/linux/rcupdate.h:302
3 locks held by kworker/u4:11/669:
#0: ffff0001b41f2d58 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2c/0x44 kernel/sched/core.c:558
#1: ffff0001b41dee48 (&per_cpu_ptr(group->pcpu, cpu)->seq){-.-.}-{0:0}, at: psi_task_switch+0x308/0x618 kernel/sched/psi.c:987
#2: ffff80008e3739c0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:302
2 locks held by getty/5774:
#0: ffff0000d24e40a0 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x3c/0x4c drivers/tty/tty_ldsem.c:340
#1: ffff8000959e02f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x414/0x1214 drivers/tty/n_tty.c:2206
2 locks held by syz-executor.3/6371:
#0: ffff0000c9ca64c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xec/0x740 block/bdev.c:884
#1: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_end_claim block/bdev.c:600 [inline]
#1: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: blkdev_put+0x130/0x740 block/bdev.c:886
1 lock held by udevd/6398:
#0: ffff0000c9ca64c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xec/0x740 block/bdev.c:884
3 locks held by syz-executor.0/6660:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
#1: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_finish_claiming+0x84/0x3dc block/bdev.c:557
#2: ffff0000c1483a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: bd_finish_claiming+0x218/0x3dc block/bdev.c:566
1 lock held by syz-executor.5/6662:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.1/6666:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.2/6675:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.4/6678:
#0: ffff0000c1483a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
#0: ffff0000c1483a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:502
1 lock held by syz-executor.4/6681:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.0/6893:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.5/6964:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.5/6965:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.1/6971:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.1/6972:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.2/6981:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.2/6985:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.4/6987:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.4/6988:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.5/7050:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.5/7051:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.1/7055:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.1/7058:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.2/7066:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.2/7069:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508
1 lock held by syz-executor.4/7073:
#0: ffff0000c9c844c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
1 lock held by syz-executor.4/7074:
#0: ffff80008e1748a8 (bdev_lock){+.+.}-{3:3}, at: bd_prepare_to_claim+0x1a4/0x49c block/bdev.c:508

=============================================



Tested on:

commit: 88500e4e reiserfs: fix journal device opening
console output: https://syzkaller.appspot.com/x/log.txt?x=11439c65680000

Hillf Danton

unread,
Oct 10, 2023, 7:14:11 AM10/10/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
--- x/fs/super.c
+++ y/fs/super.c
@@ -1461,8 +1461,6 @@ static void fs_bdev_sync(struct block_de
{
struct super_block *sb = bdev->bd_holder;

- lockdep_assert_held(&bdev->bd_holder_lock);
-
if (!super_lock_shared_active(sb))
return;
sync_filesystem(sb);
--

syzbot

unread,
Oct 10, 2023, 7:49:36 AM10/10/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

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

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

Tested on:

commit: 94f6f055 Linux 6.6-rc5
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=159efc7e680000
kernel config: https://syzkaller.appspot.com/x/.config?x=1b8c825e0d5f3f72
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=15784cde680000

syzbot

unread,
Oct 10, 2023, 10:38:01 AM10/10/23
to bra...@kernel.org, bra...@kernel.org, syzkall...@googlegroups.com
> #syz test: https://gitlab.com/brauner/linux.git b4/vfs-fixes-reiserfs

syzbot

unread,
Oct 10, 2023, 11:51:57 AM10/10/23
to bra...@kernel.org, bra...@kernel.org, syzkall...@googlegroups.com
> #syz test: https://gitlab.com/brauner/linux.git b4/vfs-super-fixes-2023-10-10

syzbot

unread,
Oct 10, 2023, 11:52:16 AM10/10/23
to bra...@kernel.org, bra...@kernel.org, syzkall...@googlegroups.com

syzbot

unread,
Oct 10, 2023, 1:18:29 PM10/10/23
to bra...@kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING: locking bug in fs_bdev_sync

------------[ cut here ]------------
DEBUG_LOCKS_WARN_ON(1)
WARNING: CPU: 0 PID: 11607 at kernel/locking/lockdep.c:232 check_wait_context kernel/locking/lockdep.c:4772 [inline]
WARNING: CPU: 0 PID: 11607 at kernel/locking/lockdep.c:232 __lock_acquire+0x78c/0x75e8 kernel/locking/lockdep.c:5086
Modules linked in:
CPU: 0 PID: 11607 Comm: syz-executor.3 Not tainted 6.6.0-rc5-syzkaller-00006-g21fe2888ad85 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : check_wait_context kernel/locking/lockdep.c:4772 [inline]
pc : __lock_acquire+0x78c/0x75e8 kernel/locking/lockdep.c:5086
lr : hlock_class kernel/locking/lockdep.c:232 [inline]
lr : check_wait_context kernel/locking/lockdep.c:4772 [inline]
lr : __lock_acquire+0x780/0x75e8 kernel/locking/lockdep.c:5086
sp : ffff80009a7875a0
x29: ffff80009a787860 x28: ffff0000d0373780 x27: ffff0000d0374228
x26: 1fffe0001a06e845 x25: ffff0000d03741e0 x24: 0000000000000001
x23: 0000000000000001 x22: 0000000000001516 x21: ffff8000913e0a80
x20: 0000000000000000 x19: ffff0000d037422c x18: 1fffe000368379ce
x17: 0000000000000000 x16: ffff80008a639e3c x15: 0000000000000001
x14: 1fffe00036837a32 x13: 0000000000000000 x12: dfff800000000000
x11: 0000000000000000 x10: 0000000000000000 x9 : 39cb12f2dbc71100
x8 : 0000000000000000 x7 : fffffffffffdb848 x6 : fffffffffffdb728
x5 : ffff80009a786e98 x4 : ffff80008e25b020 x3 : ffff8000805ad238
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000
Call trace:
check_wait_context kernel/locking/lockdep.c:4772 [inline]
__lock_acquire+0x78c/0x75e8 kernel/locking/lockdep.c:5086
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
__super_lock_shared fs/super.c:81 [inline]
super_lock_shared_active fs/super.c:1436 [inline]
fs_bdev_sync+0xa8/0x178 fs/super.c:1471
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:502
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
irq event stamp: 115
hardirqs last enabled at (115): [<ffff800080297664>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1384 [inline]
hardirqs last enabled at (115): [<ffff800080297664>] finish_lock_switch+0xbc/0x1e4 kernel/sched/core.c:5134
hardirqs last disabled at (114): [<ffff80008a70e080>] __schedule+0x2b4/0x23b4 kernel/sched/core.c:6594
softirqs last enabled at (92): [<ffff800080033cf4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (90): [<ffff800080033cc0>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
Unable to handle kernel paging request at virtual address dfff800000000019
KASAN: null-ptr-deref in range [0x00000000000000c8-0x00000000000000cf]
Mem abort info:
ESR = 0x0000000096000005
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x05: level 1 translation fault
Data abort info:
ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000
CM = 0, WnR = 0, TnD = 0, TagAccess = 0
GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[dfff800000000019] address between user and kernel address ranges
Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 11607 Comm: syz-executor.3 Tainted: G W 6.6.0-rc5-syzkaller-00006-g21fe2888ad85 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : check_wait_context kernel/locking/lockdep.c:4772 [inline]
pc : __lock_acquire+0x568/0x75e8 kernel/locking/lockdep.c:5086
lr : hlock_class kernel/locking/lockdep.c:232 [inline]
lr : check_wait_context kernel/locking/lockdep.c:4772 [inline]
lr : __lock_acquire+0x780/0x75e8 kernel/locking/lockdep.c:5086
sp : ffff80009a7875a0
x29: ffff80009a787860 x28: ffff0000d0373780 x27: ffff0000d0374228
x26: 1fffe0001a06e845 x25: ffff0000d03741e0 x24: 0000000000000001
x23: 0000000000000001 x22: 0000000000001516 x21: ffff8000913e0a80
x20: 0000000000000000 x19: 00000000000000c8 x18: 1fffe000368379ce
x17: 0000000000000000 x16: ffff80008a639e3c x15: 0000000000000001
x14: 1fffe00036837a32 x13: 0000000000000000 x12: dfff800000000000
x11: 0000000000000000 x10: 0000000000000000 x9 : 39cb12f2dbc71100
x8 : 0000000000000019 x7 : fffffffffffdb848 x6 : fffffffffffdb728
x5 : ffff80009a786e98 x4 : ffff80008e25b020 x3 : ffff8000805ad238
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000
Call trace:
check_wait_context kernel/locking/lockdep.c:4772 [inline]
__lock_acquire+0x568/0x75e8 kernel/locking/lockdep.c:5086
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
__super_lock_shared fs/super.c:81 [inline]
super_lock_shared_active fs/super.c:1436 [inline]
fs_bdev_sync+0xa8/0x178 fs/super.c:1471
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:502
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595
Code: 34000ee8 aa1f03e8 91032113 d343fe68 (38ec6908)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: 34000ee8 cbz w8, 0x1dc
4: aa1f03e8 mov x8, xzr
8: 91032113 add x19, x8, #0xc8
c: d343fe68 lsr x8, x19, #3
* 10: 38ec6908 ldrsb w8, [x8, x12] <-- trapping instruction


Tested on:

commit: 21fe2888 fs: acquire simple read side semaphore
git tree: https://gitlab.com/brauner/linux.git b4/vfs-fixes-reiserfs
console output: https://syzkaller.appspot.com/x/log.txt?x=11a107c9680000
kernel config: https://syzkaller.appspot.com/x/.config?x=1b8c825e0d5f3f72
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

syzbot

unread,
Oct 10, 2023, 1:42:30 PM10/10/23
to bra...@kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
possible deadlock in fs_bdev_sync

======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc5-syzkaller-00002-g4be2e69845c7 #0 Not tainted
------------------------------------------------------
syz-executor.2/6633 is trying to acquire lock:
ffff0000e18680e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline]
ffff0000e18680e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock_shared fs/super.c:81 [inline]
ffff0000e18680e0 (&type->s_umount_key#25){++++}-{3:3}, at: super_lock_shared_active fs/super.c:1436 [inline]
ffff0000e18680e0 (&type->s_umount_key#25){++++}-{3:3}, at: fs_bdev_sync+0xa8/0x178 fs/super.c:1471

but task is already holding lock:
ffff0000c1494608 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
ffff0000c1494608 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:502

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&bdev->bd_holder_lock){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bdev_mark_dead+0x3c/0x194 block/bdev.c:961
disk_force_media_change+0x134/0x1d8 block/disk-events.c:302
__loop_clr_fd+0x2fc/0x584 drivers/block/loop.c:1174
lo_release+0x134/0x1c8 drivers/block/loop.c:1743
blkdev_put+0x51c/0x740
kill_block_super+0x5c/0x74 fs/super.c:1654
reiserfs_kill_sb+0x134/0x14c fs/reiserfs/super.c:570
deactivate_locked_super+0xac/0x12c fs/super.c:486
deactivate_super+0xe0/0x100 fs/super.c:519
cleanup_mnt+0x34c/0x3dc fs/namespace.c:1254
__cleanup_mnt+0x20/0x30 fs/namespace.c:1261
task_work_run+0x230/0x2e0 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x2184/0x3c94 arch/arm64/kernel/signal.c:1305
exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:144 [inline]
el0_svc+0xa0/0x16c arch/arm64/kernel/entry-common.c:679
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

-> #1 (&disk->open_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
journal_init_dev fs/reiserfs/journal.c:2626 [inline]
journal_init+0xa60/0x1e44 fs/reiserfs/journal.c:2786
reiserfs_fill_super+0xd50/0x2028 fs/reiserfs/super.c:2022
mount_bdev+0x1e8/0x2b4 fs/super.c:1634
get_super_block+0x44/0x58 fs/reiserfs/super.c:2601
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1755
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

-> #0 (&type->s_umount_key#25){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5136
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
__super_lock_shared fs/super.c:81 [inline]
super_lock_shared_active fs/super.c:1436 [inline]
fs_bdev_sync+0xa8/0x178 fs/super.c:1471
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:502
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

other info that might help us debug this:

Chain exists of:
&type->s_umount_key#25 --> &disk->open_mutex --> &bdev->bd_holder_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&bdev->bd_holder_lock);
lock(&disk->open_mutex);
lock(&bdev->bd_holder_lock);
rlock(&type->s_umount_key#25);

*** DEADLOCK ***

1 lock held by syz-executor.2/6633:
#0: ffff0000c1494608 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
#0: ffff0000c1494608 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:502

stack backtrace:
CPU: 1 PID: 6633 Comm: syz-executor.2 Not tainted 6.6.0-rc5-syzkaller-00002-g4be2e69845c7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Call trace:
dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233
show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106
dump_stack+0x1c/0x28 lib/dump_stack.c:113
print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2060
check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5136
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
__super_lock_shared fs/super.c:81 [inline]
super_lock_shared_active fs/super.c:1436 [inline]
fs_bdev_sync+0xa8/0x178 fs/super.c:1471
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:502
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595


Tested on:

commit: 4be2e698 fs: acquire simple read side semaphore
git tree: https://gitlab.com/brauner/linux.git b4/vfs-super-fixes-2023-10-10
console output: https://syzkaller.appspot.com/x/log.txt?x=11c051e9680000

syzbot

unread,
Oct 10, 2023, 1:59:32 PM10/10/23
to bra...@kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
possible deadlock in fs_bdev_sync

======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc5-syzkaller-00002-g4be2e69845c7 #0 Not tainted
------------------------------------------------------
syz-executor.1/6625 is trying to acquire lock:
ffff0000cdc900e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline]
ffff0000cdc900e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock_shared fs/super.c:81 [inline]
ffff0000cdc900e0 (&type->s_umount_key#25){++++}-{3:3}, at: super_lock_shared_active fs/super.c:1436 [inline]
ffff0000cdc900e0 (&type->s_umount_key#25){++++}-{3:3}, at: fs_bdev_sync+0xa8/0x178 fs/super.c:1471

but task is already holding lock:
ffff0000c149af08 (&bdev->bd_holder_lock){+.+.}-{3:3}
, at: blkdev_flushbuf block/ioctl.c:370 [inline]
1 lock held by syz-executor.1/6625:
#0: ffff0000c149af08 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
#0: ffff0000c149af08 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:502

stack backtrace:
CPU: 1 PID: 6625 Comm: syz-executor.1 Not tainted 6.6.0-rc5-syzkaller-00002-g4be2e69845c7 #0
console output: https://syzkaller.appspot.com/x/log.txt?x=145f91de680000

syzbot

unread,
Oct 11, 2023, 4:43:47 AM10/11/23
to bra...@kernel.org, bra...@kernel.org, syzkall...@googlegroups.com
> #syz test: https://gitlab.com/brauner/linux.git b4/vfs-super-fixes-2023-10-10.v1

syzbot

unread,
Oct 11, 2023, 5:41:30 AM10/11/23
to bra...@kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
possible deadlock in super_lock_shared_active

======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc5-syzkaller-00002-g3d179422e8d3 #0 Not tainted
------------------------------------------------------
syz-executor.4/6642 is trying to acquire lock:
ffff0000e8bf40e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline]
ffff0000e8bf40e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock_shared fs/super.c:81 [inline]
ffff0000e8bf40e0 (&type->s_umount_key#25){++++}-{3:3}, at: super_lock_shared_active+0xc0/0x338 fs/super.c:1441

but task is already holding lock:
ffff0000c1493a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
ffff0000c1493a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:502

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&bdev->bd_holder_lock){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bdev_mark_dead+0x3c/0x194 block/bdev.c:961
disk_force_media_change+0x134/0x1d8 block/disk-events.c:302
__loop_clr_fd+0x2fc/0x584 drivers/block/loop.c:1174
lo_release+0x134/0x1c8 drivers/block/loop.c:1743
blkdev_put+0x51c/0x740
kill_block_super+0x5c/0x74 fs/super.c:1680
reiserfs_kill_sb+0x134/0x14c fs/reiserfs/super.c:570
deactivate_locked_super+0xac/0x12c fs/super.c:486
deactivate_super+0xe0/0x100 fs/super.c:519
cleanup_mnt+0x34c/0x3dc fs/namespace.c:1254
__cleanup_mnt+0x20/0x30 fs/namespace.c:1261
task_work_run+0x230/0x2e0 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x2184/0x3c94 arch/arm64/kernel/signal.c:1305
exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:144 [inline]
el0_svc+0xa0/0x16c arch/arm64/kernel/entry-common.c:679
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

-> #1 (&disk->open_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
journal_init_dev fs/reiserfs/journal.c:2626 [inline]
journal_init+0xa60/0x1e44 fs/reiserfs/journal.c:2786
reiserfs_fill_super+0xd50/0x2028 fs/reiserfs/super.c:2022
mount_bdev+0x1e8/0x2b4 fs/super.c:1660
get_super_block+0x44/0x58 fs/reiserfs/super.c:2601
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1781
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

-> #0 (&type->s_umount_key#25){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5136
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
__super_lock_shared fs/super.c:81 [inline]
super_lock_shared_active+0xc0/0x338 fs/super.c:1441
fs_bdev_sync+0xa4/0x12c fs/super.c:1496
1 lock held by syz-executor.4/6642:
#0: ffff0000c1493a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
#0: ffff0000c1493a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:502

stack backtrace:
CPU: 1 PID: 6642 Comm: syz-executor.4 Not tainted 6.6.0-rc5-syzkaller-00002-g3d179422e8d3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Call trace:
dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233
show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106
dump_stack+0x1c/0x28 lib/dump_stack.c:113
print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2060
check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5136
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
__super_lock_shared fs/super.c:81 [inline]
super_lock_shared_active+0xc0/0x338 fs/super.c:1441
fs_bdev_sync+0xa4/0x12c fs/super.c:1496
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:502
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:624
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595


Tested on:

commit: 3d179422 fs: massage some fs_holder_ops
git tree: https://gitlab.com/brauner/linux.git b4/vfs-super-fixes-2023-10-10.v1
console output: https://syzkaller.appspot.com/x/log.txt?x=16f6b265680000

syzbot

unread,
Oct 11, 2023, 7:22:07 AM10/11/23
to bra...@kernel.org, bra...@kernel.org, syzkall...@googlegroups.com
> #syz test: https://gitlab.com/brauner/linux.git b4/vfs-super-fixes-2023-10-10.v2

syzbot

unread,
Oct 11, 2023, 7:58:35 AM10/11/23
to bra...@kernel.org, syzkall...@googlegroups.com
Hello,

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

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

Tested on:

commit: f6c054f8 reiserfs: centralize journal device closing
git tree: https://gitlab.com/brauner/linux.git b4/vfs-super-fixes-2023-10-10.v2
console output: https://syzkaller.appspot.com/x/log.txt?x=13f98ee9680000
kernel config: https://syzkaller.appspot.com/x/.config?x=1b8c825e0d5f3f72
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

Note: no patches were applied.

syzbot

unread,
Oct 18, 2023, 8:58:48 AM10/18/23
to bra...@kernel.org, bra...@kernel.org, syzkall...@googlegroups.com
> #syz test: https://gitlab.com/brauner/linux.git vfs.super

syzbot

unread,
Oct 18, 2023, 9:04:14 AM10/18/23
to bra...@kernel.org, bra...@kernel.org, syzkall...@googlegroups.com
> #syz test: https://gitlab.com/brauner/linux.git vfs.super.2023-10-18.v2

syzbot

unread,
Oct 18, 2023, 9:30:34 AM10/18/23
to bra...@kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
possible deadlock in super_lock

======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc5-syzkaller-00265-g4735d8fc985e #0 Not tainted
------------------------------------------------------
syz-executor.3/6640 is trying to acquire lock:
ffff0000d4da00e0 (&type->s_umount_key#25){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline]
ffff0000d4da00e0 (&type->s_umount_key#25){++++}-{3:3}, at: super_lock+0x160/0x328 fs/super.c:117

but task is already holding lock:
ffff0000c1543a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
ffff0000c1543a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:504

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&bdev->bd_holder_lock){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
bdev_mark_dead+0x3c/0x194 block/bdev.c:1012
disk_force_media_change+0x134/0x1d8 block/disk-events.c:298
__loop_clr_fd+0x2fc/0x584 drivers/block/loop.c:1174
lo_release+0x134/0x1c8 drivers/block/loop.c:1743
blkdev_put+0x51c/0x740
bdev_release+0x5c/0x78 block/bdev.c:952
kill_block_super+0x74/0x90 fs/super.c:1654
reiserfs_kill_sb+0x134/0x14c fs/reiserfs/super.c:570
deactivate_locked_super+0xac/0x12c fs/super.c:481
deactivate_super+0xe0/0x100 fs/super.c:514
cleanup_mnt+0x34c/0x3dc fs/namespace.c:1254
__cleanup_mnt+0x20/0x30 fs/namespace.c:1261
task_work_run+0x230/0x2e0 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x2184/0x3c94 arch/arm64/kernel/signal.c:1305
exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:144 [inline]
el0_svc+0xa0/0x16c arch/arm64/kernel/entry-common.c:679
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

-> #1 (&disk->open_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
blkdev_get_by_dev+0x114/0x55c block/bdev.c:786
bdev_open_by_dev+0x84/0x144 block/bdev.c:840
journal_init_dev fs/reiserfs/journal.c:2619 [inline]
journal_init+0xa60/0x1ec4 fs/reiserfs/journal.c:2780
reiserfs_fill_super+0xd50/0x2028 fs/reiserfs/super.c:2022
mount_bdev+0x1e8/0x2b4 fs/super.c:1634
get_super_block+0x44/0x58 fs/reiserfs/super.c:2601
legacy_get_tree+0xd4/0x16c fs/fs_context.c:638
vfs_get_tree+0x90/0x288 fs/super.c:1755
do_new_mount+0x25c/0x8c8 fs/namespace.c:3335
path_mount+0x590/0xe04 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3861
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

-> #0 (&type->s_umount_key#25){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5136
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
super_lock+0x160/0x328 fs/super.c:117
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1431 [inline]
fs_bdev_sync+0x118/0x214 fs/super.c:1468
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:504
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:626
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

other info that might help us debug this:

Chain exists of:
&type->s_umount_key#25 --> &disk->open_mutex --> &bdev->bd_holder_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&bdev->bd_holder_lock);
lock(&disk->open_mutex);
lock(&bdev->bd_holder_lock);
rlock(&type->s_umount_key#25);

*** DEADLOCK ***

1 lock held by syz-executor.3/6640:
#0: ffff0000c1543a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline]
#0: ffff0000c1543a88 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x7fc/0x2884 block/ioctl.c:504

stack backtrace:
CPU: 1 PID: 6640 Comm: syz-executor.3 Not tainted 6.6.0-rc5-syzkaller-00265-g4735d8fc985e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Call trace:
dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233
show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106
dump_stack+0x1c/0x28 lib/dump_stack.c:113
print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2060
check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5136
lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753
down_read+0x58/0x2fc kernel/locking/rwsem.c:1520
__super_lock fs/super.c:58 [inline]
super_lock+0x160/0x328 fs/super.c:117
super_lock_shared fs/super.c:146 [inline]
super_lock_shared_active fs/super.c:1431 [inline]
fs_bdev_sync+0x118/0x214 fs/super.c:1468
blkdev_flushbuf block/ioctl.c:372 [inline]
blkdev_common_ioctl+0x848/0x2884 block/ioctl.c:504
blkdev_ioctl+0x35c/0xae4 block/ioctl.c:626
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595


Tested on:

commit: 4735d8fc porting: update locking requirements
git tree: https://gitlab.com/brauner/linux.git vfs.super
console output: https://syzkaller.appspot.com/x/log.txt?x=131898a9680000
kernel config: https://syzkaller.appspot.com/x/.config?x=130869a2f790653b

syzbot

unread,
Oct 18, 2023, 9:56:29 AM10/18/23
to bra...@kernel.org, syzkall...@googlegroups.com
Hello,

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

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

Tested on:

commit: 53fe0c82 fs: Avoid grabbing sb->s_umount under bdev->b..
git tree: https://gitlab.com/brauner/linux.git vfs.super.2023-10-18.v2
console output: https://syzkaller.appspot.com/x/log.txt?x=155c064d680000
kernel config: https://syzkaller.appspot.com/x/.config?x=130869a2f790653b
dashboard link: https://syzkaller.appspot.com/bug?extid=062317ea1d0a6d5e29e7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

Note: no patches were applied.

syzbot

unread,
Oct 22, 2023, 10:36:17 AM10/22/23
to bra...@kernel.org, bra...@kernel.org, syzkall...@googlegroups.com
> #syz test: https://gitlab.com/brauner/linux.git b4/vfs-super-freeze

syzbot

unread,
Oct 22, 2023, 11:02:41 AM10/22/23
to bra...@kernel.org, syzkall...@googlegroups.com
Hello,

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

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

Tested on:

commit: 82468373 ext4: simplify device handling
git tree: https://gitlab.com/brauner/linux.git b4/vfs-super-freeze
console output: https://syzkaller.appspot.com/x/log.txt?x=13f3e10b680000

syzbot

unread,
Dec 24, 2023, 11:40:07 AM12/24/23
to ax...@kernel.dk, bra...@kernel.org, ch...@kernel.org, chri...@brauner.io, daniel...@ffwll.ch, h...@lst.de, hda...@sina.com, ja...@suse.cz, jae...@kernel.org, jinpu...@ionos.com, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, maira...@riseup.net, mca...@igalia.com, reiserf...@vger.kernel.org, syzkall...@googlegroups.com, terr...@fb.com, wi...@infradead.org, yuk...@huawei.com
syzbot suspects this issue was fixed by commit:

commit fd1464105cb37a3b50a72c1d2902e97a71950af8
Author: Jan Kara <ja...@suse.cz>
Date: Wed Oct 18 15:29:24 2023 +0000

fs: Avoid grabbing sb->s_umount under bdev->bd_holder_lock

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14639595e80000
start commit: 2cf0f7156238 Merge tag 'nfs-for-6.6-2' of git://git.linux-..
git tree: upstream
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: fs: Avoid grabbing sb->s_umount under bdev->bd_holder_lock

Christian Brauner

unread,
Dec 28, 2023, 5:50:43 AM12/28/23
to syzbot, ax...@kernel.dk, ch...@kernel.org, chri...@brauner.io, daniel...@ffwll.ch, h...@lst.de, hda...@sina.com, ja...@suse.cz, jae...@kernel.org, jinpu...@ionos.com, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, maira...@riseup.net, mca...@igalia.com, reiserf...@vger.kernel.org, syzkall...@googlegroups.com, terr...@fb.com, wi...@infradead.org, yuk...@huawei.com
Fwiw, this was always a false-positive. But we also reworked the locking
that even the false-positive cannot be triggered anymore. So yay!

Jan Kara

unread,
Jan 2, 2024, 7:15:03 AMJan 2
to syzbot, Christian Brauner, ax...@kernel.dk, ch...@kernel.org, chri...@brauner.io, daniel...@ffwll.ch, h...@lst.de, hda...@sina.com, ja...@suse.cz, jae...@kernel.org, jinpu...@ionos.com, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, maira...@riseup.net, mca...@igalia.com, reiserf...@vger.kernel.org, syzkall...@googlegroups.com, terr...@fb.com, wi...@infradead.org, yuk...@huawei.com
Yup, nice. I think you need to start the line with syz command so:

#syz fix: fs: Avoid grabbing sb->s_umount under bdev->bd_holder_lock

Honza
--
Jan Kara <ja...@suse.com>
SUSE Labs, CR
Reply all
Reply to author
Forward
0 new messages