====================================================== WARNING: possible circular locking dependency detected 4.15.0+ #294 Not tainted ------------------------------------------------------ syz-executor4/5797 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<0000000027da1a92>] lock_sock include/net/sock.h:1461 [inline] (sk_lock-AF_INET){+.+.}, at: [<0000000027da1a92>] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<00000000430039ba>] 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 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2905 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 raw_setsockopt+0xb7/0xd0 net/ipv4/raw.c:870 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/5797: #0: (rtnl_mutex){+.+.}, at: [<00000000430039ba>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 0 PID: 5797 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 raw_setsockopt+0xb7/0xd0 net/ipv4/raw.c:870 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:00007ff72bda3c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007ff72bda4700 RCX: 0000000000453299 RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000013 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020002000 R11: 0000000000000212 R12: 0000000000000000 R13: 0000000000a2f33f R14: 00007ff72bda49c0 R15: 0000000000000000 QAT: Invalid ioctl QAT: Invalid ioctl SELinux: unrecognized netlink message: protocol=4 nlmsg_type=44 sclass=netlink_tcpdiag_socket pig=5868 comm=syz-executor6 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=44 sclass=netlink_tcpdiag_socket pig=5886 comm=syz-executor6 QAT: Invalid ioctl QAT: Invalid ioctl irq bypass consumer (token 00000000304985b5) registration fails: -16 SELinux: unknown mount option sock: sock_set_timeout: `syz-executor4' (pid 6139) tries to set negative timeout SELinux: unrecognized netlink message: protocol=0 nlmsg_type=25622 sclass=netlink_route_socket pig=6145 comm=syz-executor7 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=25622 sclass=netlink_route_socket pig=6151 comm=syz-executor7 sock: sock_set_timeout: `syz-executor4' (pid 6139) tries to set negative timeout kauditd_printk_skb: 61 callbacks suppressed audit: type=1400 audit(1517678265.544:92): avc: denied { setuid } for pid=6156 comm="syz-executor6" capability=7 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 rfkill: input handler disabled rfkill: input handler enabled CUSE: info not properly terminated audit: type=1400 audit(1517678265.664:93): avc: denied { create } for pid=6212 comm="syz-executor7" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_crypto_socket permissive=1 audit: type=1326 audit(1517678265.860:94): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=6272 comm="syz-executor4" exe="/root/syz-executor4" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453299 code=0x0 audit: type=1326 audit(1517678265.886:95): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=6272 comm="syz-executor4" exe="/root/syz-executor4" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453299 code=0x0 ipt_CLUSTERIP: Please specify destination IP FAULT_INJECTION: forcing a failure. name fail_page_alloc, interval 1, probability 0, space 0, times 1 CPU: 1 PID: 6418 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_fail_alloc_page mm/page_alloc.c:2955 [inline] prepare_alloc_pages mm/page_alloc.c:4194 [inline] __alloc_pages_nodemask+0x338/0xd80 mm/page_alloc.c:4233 alloc_pages_current+0xb6/0x1e0 mm/mempolicy.c:2055 alloc_pages include/linux/gfp.h:492 [inline] skb_page_frag_refill+0x358/0x5f0 net/core/sock.c:2211 tun_build_skb.isra.50+0x2f0/0x1810 drivers/net/tun.c:1630 tun_get_user+0x17d0/0x3940 drivers/net/tun.c:1800 tun_chr_write_iter+0xb9/0x160 drivers/net/tun.c:1986 call_write_iter include/linux/fs.h:1781 [inline] do_iter_readv_writev+0x55c/0x830 fs/read_write.c:653 do_iter_write+0x154/0x540 fs/read_write.c:932 vfs_writev+0x18a/0x340 fs/read_write.c:977 do_writev+0xfc/0x2a0 fs/read_write.c:1012 SYSC_writev fs/read_write.c:1085 [inline] SyS_writev+0x27/0x30 fs/read_write.c:1082 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453171 RSP: 002b:00007ff276100b80 EFLAGS: 00000293 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007ff276100aa0 RCX: 0000000000453171 RDX: 0000000000000001 RSI: 00007ff276100bd0 RDI: 0000000000000012 RBP: 00007ff276100a90 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000002a R11: 0000000000000293 R12: 00000000004b8096 R13: 00007ff276100bc8 R14: 00000000004b8096 R15: 0000000000000000 ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' ieee80211 phy3: Selected rate control algorithm 'minstrel_ht' ieee80211 phy4: Selected rate control algorithm 'minstrel_ht' audit: type=1400 audit(1517678267.048:96): avc: denied { ioctl } for pid=6478 comm="syz-executor7" path="socket:[15954]" dev="sockfs" ino=15954 ioctlcmd=0xaee0 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_crypto_socket permissive=1 ieee80211 phy5: Selected rate control algorithm 'minstrel_ht' ieee80211 phy6: Selected rate control algorithm 'minstrel_ht' ieee80211 phy7: Selected rate control algorithm 'minstrel_ht' ieee80211 phy8: Selected rate control algorithm 'minstrel_ht' ieee80211 phy9: Selected rate control algorithm 'minstrel_ht' mmap: syz-executor7 (6653) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. ieee80211 phy10: Selected rate control algorithm 'minstrel_ht' ieee80211 phy11: Selected rate control algorithm 'minstrel_ht' ieee80211 phy12: Selected rate control algorithm 'minstrel_ht' ieee80211 phy13: Selected rate control algorithm 'minstrel_ht' audit: type=1400 audit(1517678267.734:97): avc: denied { write } for pid=6689 comm="syz-executor5" name="net" dev="proc" ino=17081 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=dir permissive=1 audit: type=1400 audit(1517678267.735:98): avc: denied { add_name } for pid=6689 comm="syz-executor5" name="pfkey" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=dir permissive=1 ieee80211 phy14: Selected rate control algorithm 'minstrel_ht' audit: type=1400 audit(1517678267.736:99): avc: denied { create } for pid=6689 comm="syz-executor5" name="pfkey" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:insmod_t:s0 tclass=file permissive=1 ieee80211 phy15: Selected rate control algorithm 'minstrel_ht' audit: type=1400 audit(1517678267.864:100): avc: denied { map } for pid=6723 comm="syz-executor1" path=2F6D656D66643A706F73FB202864656C6574656429 dev="tmpfs" ino=16175 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:tmpfs_t:s0 tclass=file permissive=1 ieee80211 phy16: Selected rate control algorithm 'minstrel_ht' ieee80211 phy17: Selected rate control algorithm 'minstrel_ht' ieee80211 phy18: Selected rate control algorithm 'minstrel_ht' ieee80211 phy19: Selected rate control algorithm 'minstrel_ht' ieee80211 phy20: Selected rate control algorithm 'minstrel_ht' ieee80211 phy21: Selected rate control algorithm 'minstrel_ht' ieee80211 phy22: Selected rate control algorithm 'minstrel_ht' ieee80211 phy23: Selected rate control algorithm 'minstrel_ht' ieee80211 phy24: Selected rate control algorithm 'minstrel_ht' ieee80211 phy25: Selected rate control algorithm 'minstrel_ht' ieee80211 phy26: Selected rate control algorithm 'minstrel_ht' ieee80211 phy27: Selected rate control algorithm 'minstrel_ht' ieee80211 phy28: Selected rate control algorithm 'minstrel_ht' ieee80211 phy29: Selected rate control algorithm 'minstrel_ht' ieee80211 phy30: Selected rate control algorithm 'minstrel_ht' ieee80211 phy31: Selected rate control algorithm 'minstrel_ht' ieee80211 phy32: Selected rate control algorithm 'minstrel_ht' ieee80211 phy33: Selected rate control algorithm 'minstrel_ht' ieee80211 phy34: Selected rate control algorithm 'minstrel_ht' ieee80211 phy35: Selected rate control algorithm 'minstrel_ht' ieee80211 phy36: Selected rate control algorithm 'minstrel_ht' ieee80211 phy37: Selected rate control algorithm 'minstrel_ht' ieee80211 phy38: Selected rate control algorithm 'minstrel_ht' ieee80211 phy39: Selected rate control algorithm 'minstrel_ht' ieee80211 phy40: Selected rate control algorithm 'minstrel_ht' ieee80211 phy41: Selected rate control algorithm 'minstrel_ht' ieee80211 phy42: Selected rate control algorithm 'minstrel_ht' ieee80211 phy43: Selected rate control algorithm 'minstrel_ht' ieee80211 phy44: Selected rate control algorithm 'minstrel_ht' ieee80211 phy45: Selected rate control algorithm 'minstrel_ht' ieee80211 phy46: Selected rate control algorithm 'minstrel_ht' ieee80211 phy47: Selected rate control algorithm 'minstrel_ht' ieee80211 phy48: Selected rate control algorithm 'minstrel_ht' ieee80211 phy49: Selected rate control algorithm 'minstrel_ht' ieee80211 phy50: Selected rate control algorithm 'minstrel_ht' ieee80211 phy51: Selected rate control algorithm 'minstrel_ht' ieee80211 phy52: Selected rate control algorithm 'minstrel_ht' ieee80211 phy53: Selected rate control algorithm 'minstrel_ht' ieee80211 phy54: Selected rate control algorithm 'minstrel_ht' ieee80211 phy55: Selected rate control algorithm 'minstrel_ht' ieee80211 phy56: Selected rate control algorithm 'minstrel_ht' ieee80211 phy57: Selected rate control algorithm 'minstrel_ht' ieee80211 phy58: Selected rate control algorithm 'minstrel_ht' ieee80211 phy59: Selected rate control algorithm 'minstrel_ht' ieee80211 phy60: Selected rate control algorithm 'minstrel_ht' ieee80211 phy61: Selected rate control algorithm 'minstrel_ht' ieee80211 phy62: Selected rate control algorithm 'minstrel_ht' ieee80211 phy63: Selected rate control algorithm 'minstrel_ht' ieee80211 phy64: Selected rate control algorithm 'minstrel_ht' ieee80211 phy65: Selected rate control algorithm 'minstrel_ht' ieee80211 phy66: Selected rate control algorithm 'minstrel_ht' ieee80211 phy67: Selected rate control algorithm 'minstrel_ht' ieee80211 phy68: Selected rate control algorithm 'minstrel_ht' ieee80211 phy69: Selected rate control algorithm 'minstrel_ht' ieee80211 phy70: Selected rate control algorithm 'minstrel_ht' ieee80211 phy71: Selected rate control algorithm 'minstrel_ht' ieee80211 phy72: Selected rate control algorithm 'minstrel_ht' ieee80211 phy73: Selected rate control algorithm 'minstrel_ht' ieee80211 phy74: Selected rate control algorithm 'minstrel_ht' ieee80211 phy75: Selected rate control algorithm 'minstrel_ht' ieee80211 phy76: Selected rate control algorithm 'minstrel_ht' ieee80211 phy77: Selected rate control algorithm 'minstrel_ht' ieee80211 phy78: Selected rate control algorithm 'minstrel_ht' ieee80211 phy79: Selected rate control algorithm 'minstrel_ht' ieee80211 phy80: Selected rate control algorithm 'minstrel_ht' ieee80211 phy81: Selected rate control algorithm 'minstrel_ht' ieee80211 phy82: Selected rate control algorithm 'minstrel_ht' ieee80211 phy83: Selected rate control algorithm 'minstrel_ht' ieee80211 phy84: Selected rate control algorithm 'minstrel_ht' ieee80211 phy85: Selected rate control algorithm 'minstrel_ht' ieee80211 phy86: Selected rate control algorithm 'minstrel_ht' ieee80211 phy87: Selected rate control algorithm 'minstrel_ht' ieee80211 phy88: Selected rate control algorithm 'minstrel_ht' ieee80211 phy89: Selected rate control algorithm 'minstrel_ht' ieee80211 phy90: Selected rate control algorithm 'minstrel_ht' ieee80211 phy91: Selected rate control algorithm 'minstrel_ht' ieee80211 phy92: Selected rate control algorithm 'minstrel_ht' ieee80211 phy93: Selected rate control algorithm 'minstrel_ht' ieee80211 phy94: Selected rate control algorithm 'minstrel_ht' ieee80211 phy95: Selected rate control algorithm 'minstrel_ht' ieee80211 phy96: Selected rate control algorithm 'minstrel_ht' ieee80211 phy97: Selected rate control algorithm 'minstrel_ht' ieee80211 phy98: Selected rate control algorithm 'minstrel_ht' ieee80211 phy99: Selected rate control algorithm 'minstrel_ht' ieee80211 phy100: Selected rate control algorithm 'minstrel_ht' ieee80211 phy101: Selected rate control algorithm 'minstrel_ht' ieee80211 phy102: Selected rate control algorithm 'minstrel_ht' ieee80211 phy103: Selected rate control algorithm 'minstrel_ht' ieee80211 phy104: Selected rate control algorithm 'minstrel_ht' ieee80211 phy105: Selected rate control algorithm 'minstrel_ht'