possible deadlock in __get_super

15 views
Skip to first unread message

syzbot

unread,
Oct 26, 2020, 6:32:25 AM10/26/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ad326970 Linux 4.19.152
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=136cc364500000
kernel config: https://syzkaller.appspot.com/x/.config?x=1ec7667b405157e
dashboard link: https://syzkaller.appspot.com/bug?extid=f472d83492acd53a5abf
compiler: gcc (GCC) 10.1.0-syz 20200507

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

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

UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
======================================================
WARNING: possible circular locking dependency detected
4.19.152-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.3/19325 is trying to acquire lock:
00000000c81d57d0 (&type->s_umount_key#69){++++}, at: __get_super.part.0+0x209/0x2e0 fs/super.c:698

but task is already holding lock:
00000000177bc933 (&bdev->bd_mutex){+.+.}, at: blkdev_reread_part+0x1b/0x40 block/ioctl.c:192

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&bdev->bd_mutex){+.+.}:
blkdev_put+0x30/0x520 fs/block_dev.c:1839
release_journal_dev fs/reiserfs/journal.c:2601 [inline]
free_journal_ram+0x44b/0x600 fs/reiserfs/journal.c:1904
do_journal_release fs/reiserfs/journal.c:1970 [inline]
journal_release+0x225/0x4d0 fs/reiserfs/journal.c:1981
reiserfs_put_super+0xe0/0x5c0 fs/reiserfs/super.c:616
generic_shutdown_super+0x144/0x370 fs/super.c:456
kill_block_super+0x97/0xf0 fs/super.c:1185
deactivate_locked_super+0x94/0x160 fs/super.c:329
deactivate_super+0x174/0x1a0 fs/super.c:360
cleanup_mnt+0x1a8/0x290 fs/namespace.c:1098
task_work_run+0x148/0x1c0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:193 [inline]
exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 (&type->s_umount_key#69){++++}:
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
down_read+0x36/0x80 kernel/locking/rwsem.c:24
__get_super.part.0+0x209/0x2e0 fs/super.c:698
__get_super include/linux/spinlock.h:329 [inline]
get_super+0x2b/0x50 fs/super.c:727
fsync_bdev+0x14/0xc0 fs/block_dev.c:483
invalidate_partition+0x74/0xb0 block/genhd.c:1580
drop_partitions.isra.0+0x9c/0x190 block/partition-generic.c:454
rescan_partitions+0xab/0x970 block/partition-generic.c:527
__blkdev_reread_part+0x189/0x220 block/ioctl.c:173
blkdev_reread_part+0x23/0x40 block/ioctl.c:193
loop_reread_partitions drivers/block/loop.c:645 [inline]
loop_set_status+0x103e/0x1800 drivers/block/loop.c:1330
loop_set_status_old+0x1bb/0x250 drivers/block/loop.c:1440
lo_ioctl+0x3b5/0x20e0 drivers/block/loop.c:1584
__blkdev_driver_ioctl block/ioctl.c:303 [inline]
blkdev_ioctl+0x5cb/0x1a7e block/ioctl.c:601
block_ioctl+0xe9/0x130 fs/block_dev.c:1906
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&bdev->bd_mutex);
lock(&type->s_umount_key#69);
lock(&bdev->bd_mutex);
lock(&type->s_umount_key#69);

*** DEADLOCK ***

1 lock held by syz-executor.3/19325:
#0: 00000000177bc933 (&bdev->bd_mutex){+.+.}, at: blkdev_reread_part+0x1b/0x40 block/ioctl.c:192

stack backtrace:
CPU: 0 PID: 19325 Comm: syz-executor.3 Not tainted 4.19.152-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2fe lib/dump_stack.c:118
print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1221
check_prev_add kernel/locking/lockdep.c:1865 [inline]
check_prevs_add kernel/locking/lockdep.c:1978 [inline]
validate_chain kernel/locking/lockdep.c:2419 [inline]
__lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3415
lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3907
down_read+0x36/0x80 kernel/locking/rwsem.c:24
__get_super.part.0+0x209/0x2e0 fs/super.c:698
__get_super include/linux/spinlock.h:329 [inline]
get_super+0x2b/0x50 fs/super.c:727
fsync_bdev+0x14/0xc0 fs/block_dev.c:483
invalidate_partition+0x74/0xb0 block/genhd.c:1580
drop_partitions.isra.0+0x9c/0x190 block/partition-generic.c:454
rescan_partitions+0xab/0x970 block/partition-generic.c:527
__blkdev_reread_part+0x189/0x220 block/ioctl.c:173
blkdev_reread_part+0x23/0x40 block/ioctl.c:193
loop_reread_partitions drivers/block/loop.c:645 [inline]
loop_set_status+0x103e/0x1800 drivers/block/loop.c:1330
loop_set_status_old+0x1bb/0x250 drivers/block/loop.c:1440
lo_ioctl+0x3b5/0x20e0 drivers/block/loop.c:1584
__blkdev_driver_ioctl block/ioctl.c:303 [inline]
blkdev_ioctl+0x5cb/0x1a7e block/ioctl.c:601
block_ioctl+0xe9/0x130 fs/block_dev.c:1906
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45de59
Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f07acc23c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000012ac0 RCX: 000000000045de59
RDX: 0000000020000440 RSI: 0000000000004c02 RDI: 0000000000000003
RBP: 000000000118c008 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bfd4
R13: 00007ffcead6f8af R14: 00007f07acc249c0 R15: 000000000118bfd4
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
netlink: 'syz-executor.3': attribute type 4 has an invalid length.
netlink: 'syz-executor.3': attribute type 2 has an invalid length.
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
netlink: 'syz-executor.3': attribute type 4 has an invalid length.
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
netlink: 'syz-executor.3': attribute type 2 has an invalid length.
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
netlink: 'syz-executor.3': attribute type 4 has an invalid length.
netlink: 'syz-executor.3': attribute type 2 has an invalid length.
netlink: 'syz-executor.3': attribute type 4 has an invalid length.
netlink: 'syz-executor.3': attribute type 2 has an invalid length.
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
netlink: 'syz-executor.3': attribute type 4 has an invalid length.
netlink: 'syz-executor.3': attribute type 2 has an invalid length.
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop3): super-6505 reiserfs_getopt: head of option "barrier" is only correct

REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop3): super-6505 reiserfs_getopt: head of option "barrier" is only correct

UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
REISERFS warning (device loop3): super-6505 reiserfs_getopt: head of option "barrier" is only correct

UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop3): super-6505 reiserfs_getopt: head of option "barrier" is only correct

UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop3): super-6505 reiserfs_getopt: head of option "barrier" is only correct

REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'.
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): reiserfs_fill_super: Cannot allocate commit workqueue
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
REISERFS warning (device loop0): sh-2011 read_super_block: can't find a reiserfs filesystem on (dev loop0, block 16, size 4096)
UDF-fs: warning (device loop1): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
REISERFS warning (device loop0): sh-2021 reiserfs_fill_super: can not find reiserfs on loop0
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)


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

syzbot

unread,
Apr 22, 2021, 8:47:11 AM4/22/21
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages