====================================================== WARNING: possible circular locking dependency detected 4.15.0+ #294 Not tainted ------------------------------------------------------ syz-executor4/5752 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<000000005f2f8569>] lock_sock include/net/sock.h:1461 [inline] (sk_lock-AF_INET){+.+.}, at: [<000000005f2f8569>] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<0000000063993d20>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (rtnl_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 register_netdevice_notifier+0xad/0x860 net/core/dev.c:1607 tee_tg_check+0x1a0/0x280 net/netfilter/xt_TEE.c:106 xt_check_target+0x22c/0x7d0 net/netfilter/x_tables.c:845 check_target net/ipv4/netfilter/ip_tables.c:513 [inline] find_check_entry.isra.8+0x8c8/0xcb0 net/ipv4/netfilter/ip_tables.c:554 translate_table+0xed1/0x1610 net/ipv4/netfilter/ip_tables.c:725 do_replace net/ipv4/netfilter/ip_tables.c:1141 [inline] do_ipt_set_ctl+0x370/0x5f0 net/ipv4/netfilter/ip_tables.c:1675 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ip_setsockopt+0xa1/0xb0 net/ipv4/ip_sockglue.c:1260 sctp_setsockopt+0x2b6/0x61d0 net/sctp/socket.c:4104 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 entry_SYSCALL_64_fastpath+0x29/0xa0 -> #0 (sk_lock-AF_INET){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 lock_sock_nested+0xc2/0x110 net/core/sock.c:2780 lock_sock include/net/sock.h:1461 [inline] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 ip_setsockopt+0x3a/0xb0 net/ipv4/ip_sockglue.c:1252 sctp_setsockopt+0x2b6/0x61d0 net/sctp/socket.c:4104 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 entry_SYSCALL_64_fastpath+0x29/0xa0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(sk_lock-AF_INET); lock(rtnl_mutex); lock(sk_lock-AF_INET); *** DEADLOCK *** 1 lock held by syz-executor4/5752: #0: (rtnl_mutex){+.+.}, at: [<0000000063993d20>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 1 PID: 5752 Comm: syz-executor4 Not tainted 4.15.0+ #294 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_circular_bug.isra.38+0x2cd/0x2dc kernel/locking/lockdep.c:1223 check_prev_add kernel/locking/lockdep.c:1863 [inline] check_prevs_add kernel/locking/lockdep.c:1976 [inline] validate_chain kernel/locking/lockdep.c:2417 [inline] __lock_acquire+0x30a8/0x3e00 kernel/locking/lockdep.c:3431 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 lock_sock_nested+0xc2/0x110 net/core/sock.c:2780 lock_sock include/net/sock.h:1461 [inline] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 ip_setsockopt+0x3a/0xb0 net/ipv4/ip_sockglue.c:1252 sctp_setsockopt+0x2b6/0x61d0 net/sctp/socket.c:4104 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007fba011cfc58 EFLAGS: 00000212 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: 0000000000000030 RSI: 0000000000000000 RDI: 0000000000000013 RBP: 00000000000003d9 R08: 00000000000002c0 R09: 0000000000000000 R10: 00000000201c1cf0 R11: 0000000000000212 R12: 00000000006f4cf8 R13: 00000000ffffffff R14: 00007fba011d06d4 R15: 0000000000000000 netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'. binder: BINDER_SET_CONTEXT_MGR already set netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'. binder: 5795:5805 ioctl 40046207 0 returned -16 binder: 5795:5805 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'. binder: undelivered death notification, 0000000000000000 capability: warning: `syz-executor1' uses 32-bit capabilities (legacy support in use) binder_alloc: 5881: binder_alloc_buf, no vma binder: 5881:5887 transaction failed 29189/-3, size 0-0 line 2957 binder: BINDER_SET_CONTEXT_MGR already set binder: 5881:5904 ioctl 40046207 0 returned -16 netlink: 'syz-executor0': attribute type 21 has an invalid length. netlink: 'syz-executor0': attribute type 21 has an invalid length. ipt_CLUSTERIP: Please specify destination IP ipt_CLUSTERIP: Please specify destination IP ptrace attach of "/root/syz-executor2"[5580] was attempted by "/root/syz-executor2"[6065] kauditd_printk_skb: 27 callbacks suppressed audit: type=1400 audit(1517691369.986:73): avc: denied { bind } for pid=6122 comm="syz-executor4" 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(1517691370.048:74): avc: denied { map } for pid=6150 comm="syz-executor4" path="/dev/binder0" dev="devtmpfs" ino=94 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:device_t:s0 tclass=chr_file permissive=1 binder: 6150:6151 ioctl 4c08 7 returned -22 binder: send failed reply for transaction 6 to 6150:6156 binder: 6150:6156 ioctl 4c08 7 returned -22 binder: send failed reply for transaction 8 to 6150:6161 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 QAT: Invalid ioctl dccp_v4_rcv: dropped packet with invalid checksum dccp_v4_rcv: dropped packet with invalid checksum QAT: Invalid ioctl audit: type=1400 audit(1517691370.444:75): avc: denied { map } for pid=6245 comm="syz-executor1" path=2F616E6F6E5F6875676570616765202864656C6574656429 dev="hugetlbfs" ino=16263 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:hugetlbfs_t:s0 tclass=file permissive=1 binder: 6253 RLIMIT_NICE not set binder: BINDER_SET_CONTEXT_MGR already set binder: 6238:6253 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_COMPLETE audit: type=1400 audit(1517691370.689:76): avc: denied { ipc_lock } for pid=6314 comm="syz-executor3" capability=14 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1 FAULT_FLAG_ALLOW_RETRY missing 30 CPU: 1 PID: 6293 Comm: syz-executor4 Not tainted 4.15.0+ #294 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 handle_userfault+0xbd9/0x2500 fs/userfaultfd.c:430 do_anonymous_page mm/memory.c:3153 [inline] handle_pte_fault mm/memory.c:3967 [inline] __handle_mm_fault+0x32a3/0x3ce0 mm/memory.c:4093 handle_mm_fault+0x38f/0x930 mm/memory.c:4130 __do_page_fault+0x5c9/0xc90 arch/x86/mm/fault.c:1426 do_page_fault+0xee/0x720 arch/x86/mm/fault.c:1501 page_fault+0x2c/0x60 arch/x86/entry/entry_64.S:1261 RIP: 0010:fault_in_pages_readable include/linux/pagemap.h:601 [inline] RIP: 0010:iov_iter_fault_in_readable+0x1a7/0x410 lib/iov_iter.c:421 RSP: 0018:ffff8801ac14f928 EFLAGS: 00010246 RAX: 0000000000010000 RBX: 0000000020011fd2 RCX: ffffffff825ae3d1 RDX: 0000000000000100 RSI: ffffc90002972000 RDI: ffff8801ac14fd28 RBP: ffff8801ac14fa08 R08: 0000000000000000 R09: 1ffff10035829ed1 R10: ffff8801ac14f858 R11: ffff8801d10b66d0 R12: 1ffff10035829f28 R13: ffff8801ac14f9e0 R14: 0000000000000000 R15: ffff8801ac14fd20 generic_perform_write+0x200/0x600 mm/filemap.c:3128 __generic_file_write_iter+0x366/0x5b0 mm/filemap.c:3263 generic_file_write_iter+0x399/0x790 mm/filemap.c:3291 call_write_iter include/linux/fs.h:1781 [inline] new_sync_write fs/read_write.c:469 [inline] __vfs_write+0x684/0x970 fs/read_write.c:482 vfs_write+0x189/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007fba011cfc58 EFLAGS: 00000212 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: 0000000000000030 RSI: 0000000020011fd2 RDI: 0000000000000015 RBP: 0000000000000407 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f5148 R13: 00000000ffffffff R14: 00007fba011d06d4 R15: 0000000000000000 Protocol error: SET target dimension is over the limit! Protocol error: SET target dimension is over the limit! audit: type=1400 audit(1517691371.384:77): avc: denied { create } for pid=6385 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 mmap: syz-executor1 (6397) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. audit: type=1400 audit(1517691371.411:78): avc: denied { write } for pid=6385 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 audit: type=1400 audit(1517691371.455:79): avc: denied { read } for pid=6385 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 audit: type=1400 audit(1517691371.652:80): avc: denied { read } for pid=6458 comm="syz-executor0" path="socket:[16551]" dev="sockfs" ino=16551 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(1517691371.821:81): avc: denied { setfcap } for pid=6494 comm="syz-executor3" capability=31 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1 atomic_op 0000000042d0f3df conn xmit_atomic (null) SELinux: unrecognized netlink message: protocol=0 nlmsg_type=256 sclass=netlink_route_socket pig=6623 comm=syz-executor4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=256 sclass=netlink_route_socket pig=6634 comm=syz-executor4 QAT: Invalid ioctl device lo entered promiscuous mode device lo left promiscuous mode QAT: Invalid ioctl device lo entered promiscuous mode device lo left promiscuous mode FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 CPU: 1 PID: 6758 Comm: syz-executor5 Not tainted 4.15.0+ #294 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 fail_dump lib/fault-inject.c:51 [inline] should_fail+0x8c0/0xa40 lib/fault-inject.c:149 should_failslab+0xec/0x120 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:418 [inline] slab_alloc mm/slab.c:3364 [inline] kmem_cache_alloc_trace+0x4b/0x750 mm/slab.c:3604 kmalloc include/linux/slab.h:499 [inline] bdi_split_work_to_wbs+0x589/0x11f0 fs/fs-writeback.c:831 sync_inodes_sb+0x2f2/0x420 fs/fs-writeback.c:2425 sync_inodes_one_sb+0x3b/0x50 fs/sync.c:74 iterate_supers+0x12e/0x250 fs/super.c:598 sys_sync+0xe4/0x1c0 fs/sync.c:113 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007f4ebed35c58 EFLAGS: 00000212 ORIG_RAX: 00000000000000a2 RAX: ffffffffffffffda RBX: 00007f4ebed35aa0 RCX: 0000000000453299 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f4ebed35a90 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000004b8096 R13: 00007f4ebed35bc8 R14: 00000000004b8096 R15: 0000000000000000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 6781 Comm: syz-executor5 Not tainted 4.15.0+ #294 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 fail_dump lib/fault-inject.c:51 [inline] should_fail+0x8c0/0xa40 lib/fault-inject.c:149 should_failslab+0xec/0x120 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:418 [inline] slab_alloc mm/slab.c:3364 [inline] kmem_cache_alloc+0x47/0x760 mm/slab.c:3538 mempool_alloc_slab+0x44/0x60 mm/mempool.c:450 mempool_alloc+0x16a/0x4b0 mm/mempool.c:330 bio_alloc_bioset+0x3cd/0x760 block/bio.c:486 bio_alloc include/linux/bio.h:428 [inline] submit_bh_wbc+0x104/0x710 fs/buffer.c:3073 __block_write_full_page+0x534/0xbf0 fs/buffer.c:1781 block_write_full_page+0x125/0x230 fs/buffer.c:2967 blkdev_writepage+0x24/0x30 fs/block_dev.c:566 __writepage+0x5f/0xc0 mm/page-writeback.c:2301 write_cache_pages+0x72c/0x14b0 mm/page-writeback.c:2239 generic_writepages+0xe9/0x150 mm/page-writeback.c:2325 blkdev_writepages+0x1d/0x30 fs/block_dev.c:1939 do_writepages+0xff/0x170 mm/page-writeback.c:2340 __filemap_fdatawrite_range+0x32f/0x460 mm/filemap.c:444 __filemap_fdatawrite mm/filemap.c:452 [inline] filemap_fdatawrite+0x26/0x30 mm/filemap.c:457 fdatawrite_one_bdev+0x50/0x70 fs/sync.c:85 iterate_bdevs+0x109/0x260 fs/block_dev.c:2147 sys_sync+0x112/0x1c0 fs/sync.c:116 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007f4ebed35c58 EFLAGS: 00000212 ORIG_RAX: 00000000000000a2 RAX: ffffffffffffffda RBX: 00007f4ebed35aa0 RCX: 0000000000453299 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f4ebed35a90 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000004b8096 R13: 00007f4ebed35bc8 R14: 00000000004b8096 R15: 0000000000000000 sg_write: data in/out 700410/58 bytes for SCSI command 0xe2-- guessing data in; program syz-executor6 not setting count and/or reply_len properly sg_write: data in/out 700410/58 bytes for SCSI command 0xe2-- guessing data in; program syz-executor6 not setting count and/or reply_len properly QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl netlink: 'syz-executor7': attribute type 21 has an invalid length. netlink: 'syz-executor7': attribute type 21 has an invalid length. QAT: Invalid ioctl QAT: Invalid ioctl device eql entered promiscuous mode