====================================================== [ INFO: possible circular locking dependency detected ] 4.4.174+ #17 Not tainted ------------------------------------------------------- syz-executor.2/20722 is trying to acquire lock: (&bdev->bd_mutex){+.+.+.}, at: [] blkdev_reread_part+0x1f/0x40 block/ioctl.c:189 but task is already holding lock: (loop_ctl_mutex#2){+.+.+.}, at: [] lo_compat_ioctl+0x105/0x140 drivers/block/loop.c:1599 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: audit_printk_skb: 222 callbacks suppressed audit: type=1400 audit(1574996543.307:13349): avc: denied { create } for pid=20721 comm="syz-executor.3" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1574996543.307:13350): avc: denied { write } for pid=20721 comm="syz-executor.3" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc1/0xb80 kernel/locking/mutex.c:621 audit: type=1400 audit(1574996543.307:13351): avc: denied { read } for pid=20721 comm="syz-executor.3" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 [] __lo_release drivers/block/loop.c:1653 [inline] [] lo_release+0x84/0x1b0 drivers/block/loop.c:1676 [] __blkdev_put+0x461/0x840 fs/block_dev.c:1535 [] blkdev_put+0x88/0x560 fs/block_dev.c:1600 [] blkdev_close+0x8b/0xb0 fs/block_dev.c:1607 [] __fput+0x246/0x710 fs/file_table.c:208 [] ____fput+0x16/0x20 fs/file_table.c:244 [] task_work_run+0x202/0x2b0 kernel/task_work.c:115 [] tracehook_notify_resume include/linux/tracehook.h:191 [inline] [] exit_to_usermode_loop+0x14a/0x170 arch/x86/entry/common.c:188 [] prepare_exit_to_usermode arch/x86/entry/common.c:221 [inline] [] syscall_return_slowpath+0x25b/0x2e0 arch/x86/entry/common.c:286 [] int_ret_from_sys_call+0x25/0xa3 [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc1/0xb80 kernel/locking/mutex.c:621 [] lo_open+0x1d/0xb0 drivers/block/loop.c:1633 [] __blkdev_get+0x2ae/0xdf0 fs/block_dev.c:1213 [] blkdev_get+0x2e8/0x920 fs/block_dev.c:1353 [] blkdev_open+0x1aa/0x250 fs/block_dev.c:1508 [] do_dentry_open+0x38f/0xbd0 fs/open.c:749 [] vfs_open+0x10b/0x210 fs/open.c:862 audit: type=1400 audit(1574996543.307:13352): avc: denied { create } for pid=20716 comm="syz-executor.1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1574996543.307:13353): avc: denied { write } for pid=20716 comm="syz-executor.1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 [] do_last fs/namei.c:3269 [inline] [] path_openat+0x136f/0x4470 fs/namei.c:3406 [] do_filp_open+0x1a1/0x270 fs/namei.c:3440 [] do_sys_open+0x2f8/0x600 fs/open.c:1038 [] SYSC_open fs/open.c:1056 [inline] [] SyS_open+0x2d/0x40 fs/open.c:1051 [] entry_SYSCALL_64_fastpath+0x1e/0x9a audit: type=1400 audit(1574996543.307:13354): avc: denied { read } for pid=20716 comm="syz-executor.1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 [] check_prev_add kernel/locking/lockdep.c:1853 [inline] [] check_prevs_add kernel/locking/lockdep.c:1958 [inline] [] validate_chain kernel/locking/lockdep.c:2144 [inline] [] __lock_acquire+0x37d6/0x4f50 kernel/locking/lockdep.c:3213 [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc1/0xb80 kernel/locking/mutex.c:621 [] blkdev_reread_part+0x1f/0x40 block/ioctl.c:189 [] loop_reread_partitions+0x7c/0x90 drivers/block/loop.c:649 [] loop_set_status+0xc02/0x1260 drivers/block/loop.c:1208 [] loop_set_status_compat+0xb2/0x110 drivers/block/loop.c:1572 [] lo_compat_ioctl+0x110/0x140 drivers/block/loop.c:1600 [] compat_blkdev_ioctl+0xca0/0x344f block/compat_ioctl.c:751 [] C_SYSC_ioctl fs/compat_ioctl.c:1592 [inline] [] compat_SyS_ioctl+0x403/0x2210 fs/compat_ioctl.c:1544 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a other info that might help us debug this: Chain exists of: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(loop_ctl_mutex#2); lock(loop_index_mutex); lock(loop_ctl_mutex#2); lock(&bdev->bd_mutex); *** DEADLOCK *** 1 lock held by syz-executor.2/20722: #0: (loop_ctl_mutex#2){+.+.+.}, at: [] lo_compat_ioctl+0x105/0x140 drivers/block/loop.c:1599 stack backtrace: CPU: 0 PID: 20722 Comm: syz-executor.2 Not tainted 4.4.174+ #17 0000000000000000 b46cbfc1ac224ffa ffff8801b2d775e0 ffffffff81aad1a1 ffffffff84057a80 ffff8801cf040000 ffffffff83aa0cc0 ffffffff83ac6730 ffffffff83aa1890 ffff8801b2d77630 ffffffff813abcda ffffffff83e1aa00 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [] print_circular_bug.cold+0x2f7/0x44e kernel/locking/lockdep.c:1226 [] check_prev_add kernel/locking/lockdep.c:1853 [inline] [] check_prevs_add kernel/locking/lockdep.c:1958 [inline] [] validate_chain kernel/locking/lockdep.c:2144 [inline] [] __lock_acquire+0x37d6/0x4f50 kernel/locking/lockdep.c:3213 [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __mutex_lock_common kernel/locking/mutex.c:521 [inline] [] mutex_lock_nested+0xc1/0xb80 kernel/locking/mutex.c:621 [] blkdev_reread_part+0x1f/0x40 block/ioctl.c:189 [] loop_reread_partitions+0x7c/0x90 drivers/block/loop.c:649 [] loop_set_status+0xc02/0x1260 drivers/block/loop.c:1208 [] loop_set_status_compat+0xb2/0x110 drivers/block/loop.c:1572 [] lo_compat_ioctl+0x110/0x140 drivers/block/loop.c:1600 [] compat_blkdev_ioctl+0xca0/0x344f block/compat_ioctl.c:751 [] C_SYSC_ioctl fs/compat_ioctl.c:1592 [inline] [] compat_SyS_ioctl+0x403/0x2210 fs/compat_ioctl.c:1544 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a loop_reread_partitions: partition scan of loop0 ( ñy§rZ³²èï>¥iÛj¦î$^¡g /¼ }÷ó€éI­×oòzy#¸„«`‰¡Þ‡£RnVÊAIn) failed (rc=-13) loop_reread_partitions: partition scan of loop0 () failed (rc=-13) audit: type=1400 audit(1574996544.447:13355): avc: denied { write } for pid=2108 comm="syz-executor.0" name="462" dev="tmpfs" ino=69071 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:insmod_t:s0 tclass=dir permissive=1 audit: type=1400 audit(1574996544.677:13356): avc: denied { remove_name } for pid=2108 comm="syz-executor.0" name="cgroup.net" dev="tmpfs" ino=69884 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:insmod_t:s0 tclass=dir permissive=1 audit: type=1400 audit(1574996544.787:13357): avc: denied { unlink } for pid=2108 comm="syz-executor.0" name="cgroup.net" dev="tmpfs" ino=69884 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:insmod_t:s0 tclass=lnk_file permissive=1 audit: type=1400 audit(1574996544.947:13358): avc: denied { write } for pid=2108 comm="syz-executor.0" name="462" dev="tmpfs" ino=69071 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:insmod_t:s0 tclass=dir permissive=1 kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 20791 Comm: syz-executor.3 Not tainted 4.4.174+ #17 task: ffff8800ba3d17c0 task.stack: ffff8801d2430000 RIP: 0010:[] [] netlink_getsockbyportid net/netlink/af_netlink.c:1112 [inline] RIP: 0010:[] [] netlink_unicast+0x1cb/0x700 net/netlink/af_netlink.c:1297 RSP: 0018:ffff8801d2437738 EFLAGS: 00010212 RAX: dffffc0000000048 RBX: 0000000000000000 RCX: ffffc90000318000 RDX: 0000000000015ad7 RSI: ffffffff822eee24 RDI: ffff8800bba43858 RBP: ffff8801d24377f0 R08: 1ffff10017013322 R09: ffffed0017013327 R10: ffffed0017013326 R11: ffff8800b8099937 R12: dffffc0000000000 R13: dffffc0000000000 R14: ffff8800bba43780 R15: 00000000000000ea FS: 0000000000000000(0000) GS:ffff8801db700000(0063) knlGS:00000000f55fab40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 0000000000c37d40 CR3: 00000001d293f000 CR4: 00000000001606b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffff8800b80999c0 0000000000000030 0000000000000240 1ffff1003a486eed dffffc0000000006 dffffc0000000048 0000000041b58ab3 ffffffff82c9f14a ffffffff822eec60 ffffffff821f812c 0000000000000000 ffff8800b8099900 Call Trace: [] netlink_ack+0x236/0x4c0 net/netlink/af_netlink.c:2334 [] nfnetlink_rcv_batch net/netfilter/nfnetlink.c:319 [inline] [] nfnetlink_rcv+0xbdd/0x12b0 net/netfilter/nfnetlink.c:477 [] netlink_unicast_kernel net/netlink/af_netlink.c:1277 [inline] [] netlink_unicast+0x4d7/0x700 net/netlink/af_netlink.c:1303 [] netlink_sendmsg+0x6b6/0xc80 net/netlink/af_netlink.c:1859 [] sock_sendmsg_nosec net/socket.c:638 [inline] [] sock_sendmsg+0xbe/0x110 net/socket.c:648 [] ___sys_sendmsg+0x769/0x890 net/socket.c:1975 [] __sys_sendmsg+0xc5/0x160 net/socket.c:2009 [] C_SYSC_sendmsg net/compat.c:725 [inline] [] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:723 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a Code: ec a7 01 ff 48 8d 55 98 48 89 d9 4c 89 f6 4c 89 e7 e8 fa f6 ff ff 83 f8 01 0f 85 e6 03 00 00 e8 cc a7 01 ff 48 8b 85 70 ff ff ff <0f> b6 00 84 c0 74 08 3c 03 0f 8e 16 04 00 00 48 8b 85 68 ff ff RIP [] netlink_getsockbyportid net/netlink/af_netlink.c:1112 [inline] RIP [] netlink_unicast+0x1cb/0x700 net/netlink/af_netlink.c:1297 RSP ---[ end trace 8fbcff2960e3bbe6 ]---