====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc1+ #315 Not tainted ------------------------------------------------------ syz-executor1/5466 is trying to acquire lock: (sk_lock-AF_INET6){+.+.}, at: [<0000000015c52398>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET6){+.+.}, at: [<0000000015c52398>] do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<00000000f7bfa9e3>] 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: -> #2 (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 unregister_netdevice_notifier+0x91/0x4e0 net/core/dev.c:1673 tee_tg_destroy+0x61/0xc0 net/netfilter/xt_TEE.c:123 cleanup_entry+0x242/0x380 net/ipv6/netfilter/ip6_tables.c:673 __do_replace+0x7ac/0xa70 net/ipv6/netfilter/ip6_tables.c:1108 do_replace net/ipv6/netfilter/ip6_tables.c:1164 [inline] do_ip6t_set_ctl+0x40f/0x5f0 net/ipv6/netfilter/ip6_tables.c:1686 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x10b/0x130 net/ipv6/ipv6_sockglue.c:927 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2905 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2975 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #1 (&xt[i].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 xt_find_table_lock+0x3e/0x3e0 net/netfilter/x_tables.c:1046 xt_request_find_table_lock+0x28/0xc0 net/netfilter/x_tables.c:1093 get_info+0x154/0x690 net/ipv6/netfilter/ip6_tables.c:989 do_ip6t_get_ctl+0x159/0xaf0 net/ipv6/netfilter/ip6_tables.c:1710 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x6a/0xc0 net/netfilter/nf_sockopt.c:122 ipv6_getsockopt+0x1df/0x2e0 net/ipv6/ipv6_sockglue.c:1371 tcp_getsockopt+0x82/0xd0 net/ipv4/tcp.c:3359 sock_common_getsockopt+0x95/0xd0 net/core/sock.c:2934 SYSC_getsockopt net/socket.c:1880 [inline] SyS_getsockopt+0x178/0x340 net/socket.c:1862 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #0 (sk_lock-AF_INET6){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 lock_sock_nested+0xc2/0x110 net/core/sock.c:2777 lock_sock include/net/sock.h:1463 [inline] do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 ipv6_setsockopt+0xd7/0x130 net/ipv6/ipv6_sockglue.c:922 sctp_setsockopt+0x2b6/0x61d0 net/sctp/socket.c:4104 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2975 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Chain exists of: sk_lock-AF_INET6 --> &xt[i].mutex --> rtnl_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(&xt[i].mutex); lock(rtnl_mutex); lock(sk_lock-AF_INET6); *** DEADLOCK *** 1 lock held by syz-executor1/5466: #0: (rtnl_mutex){+.+.}, at: [<00000000f7bfa9e3>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 1 PID: 5466 Comm: syz-executor1 Not tainted 4.16.0-rc1+ #315 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:2777 lock_sock include/net/sock.h:1463 [inline] do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 ipv6_setsockopt+0xd7/0x130 net/ipv6/ipv6_sockglue.c:922 sctp_setsockopt+0x2b6/0x61d0 net/sctp/socket.c:4104 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2975 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453a59 RSP: 002b:00007fddba07cc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007fddba07d6d4 RCX: 0000000000453a59 RDX: 000000000000002a RSI: 0000000000000029 RDI: 0000000000000013 RBP: 000000000071bea0 R08: 0000000000000088 R09: 0000000000000000 R10: 0000000020058000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000004fb R14: 00000000006f7828 R15: 0000000000000000 audit: type=1400 audit(1518802735.389:23): avc: denied { map } for pid=5477 comm="syz-executor4" path="/dev/binder0" dev="devtmpfs" ino=129 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: BINDER_SET_CONTEXT_MGR already set binder: 5477:5501 ioctl 40046207 0 returned -16 binder_alloc: 5477: binder_alloc_buf, no vma NFQUEUE: number of total queues is 0 binder: 5477:5508 transaction failed 29189/-3, size 24-8 line 2957 audit: type=1400 audit(1518802735.415:24): avc: denied { call } for pid=5477 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=binder permissive=1 audit: type=1400 audit(1518802735.415:25): avc: denied { transfer } for pid=5477 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=binder permissive=1 NFQUEUE: number of total queues is 0 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 5477:5486 transaction 16 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 16, target dead mmap: syz-executor6 (5543) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. TCP: request_sock_TCPv6: Possible SYN flooding on port 20010. Sending cookies. Check SNMP counters. xt_SECMARK: invalid mode: 0 xt_SECMARK: invalid mode: 0 can: request_module (can-proto-3) failed. can: request_module (can-proto-3) failed. xt_connbytes: Forcing CT accounting to be enabled sock: sock_set_timeout: `syz-executor2' (pid 6240) tries to set negative timeout sock: sock_set_timeout: `syz-executor2' (pid 6240) tries to set negative timeout binder: 6389:6394 transaction failed 29189/-22, size 0-0 line 2842 binder: undelivered TRANSACTION_ERROR: 29189 binder: 6389:6406 transaction failed 29189/-22, size 0-0 line 2842 binder: undelivered TRANSACTION_ERROR: 29189 netlink: 'syz-executor0': attribute type 1 has an invalid length. netlink: 'syz-executor0': attribute type 1 has an invalid length. netlink: 'syz-executor0': attribute type 1 has an invalid length. netlink: 'syz-executor0': attribute type 1 has an invalid length. syz-executor6 uses obsolete (PF_INET,SOCK_PACKET) netlink: 'syz-executor0': attribute type 1 has an invalid length. PPPIOCDETACH file->f_count=2 PPPIOCDETACH file->f_count=2 PPPIOCDETACH file->f_count=2 PPPIOCDETACH file->f_count=2 PPPIOCDETACH file->f_count=2 kauditd_printk_skb: 8 callbacks suppressed audit: type=1400 audit(1518802739.049:34): avc: denied { map } for pid=6761 comm="syz-executor5" path="/dev/audio" dev="devtmpfs" ino=9158 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sound_device_t:s0 tclass=chr_file permissive=1 capability: warning: `syz-executor0' uses 32-bit capabilities (legacy support in use) binder: 6768:6775 transaction failed 29189/-22, size 0-8 line 2842 device syz4 entered promiscuous mode binder: 6768:6775 ioctl c0306201 2000b000 returned -14 audit: type=1400 audit(1518802739.130:35): avc: denied { read } for pid=6772 comm="syz-executor2" path="socket:[19491]" dev="sockfs" ino=19491 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 device eql entered promiscuous mode binder_alloc: binder_alloc_mmap_handler: 6768 20007000-20008000 already mapped failed -16 binder: 6768:6775 transaction failed 29189/-22, size 0-8 line 2842 binder: 6768:6775 ioctl c0306201 2000b000 returned -14 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 irq bypass consumer (token 00000000edd9684e) registration fails: -16 audit: type=1400 audit(1518802739.474:36): avc: denied { ipc_owner } for pid=6878 comm="syz-executor0" capability=15 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 binder: 6894 RLIMIT_NICE not set binder: 6894 RLIMIT_NICE not set binder: BINDER_SET_CONTEXT_MGR already set binder: 6888:6905 ioctl 40046207 0 returned -16 binder: 6894 RLIMIT_NICE not set binder: release 6888:6894 transaction 24 in, still active binder: send failed reply for transaction 24 to 6888:6905 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 SELinux: unrecognized netlink message: protocol=9 nlmsg_type=24 sclass=netlink_audit_socket pig=6962 comm=syz-executor3 binder_alloc: binder_alloc_mmap_handler: 6951 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 6951:6955 ioctl 40046207 0 returned -16 binder_alloc: 6951: binder_alloc_buf, no vma binder: 6951:6967 transaction failed 29189/-3, size 0-0 line 2957 SELinux: unrecognized netlink message: protocol=9 nlmsg_type=24 sclass=netlink_audit_socket pig=6962 comm=syz-executor3 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 6951:6955 transaction 26 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 26, target dead syz-executor5 (6981) used greatest stack depth: 16480 bytes left syz-executor5 (7045) used greatest stack depth: 16320 bytes left audit: type=1400 audit(1518802740.293:37): avc: denied { name_connect } for pid=7119 comm="syz-executor7" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:port_t:s0 tclass=dccp_socket permissive=1 audit: type=1400 audit(1518802740.444:38): avc: denied { name_bind } for pid=7177 comm="syz-executor2" src=20008 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:port_t:s0 tclass=dccp_socket permissive=1 audit: type=1400 audit(1518802740.444:39): avc: denied { node_bind } for pid=7177 comm="syz-executor2" saddr=::1 src=20008 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:node_t:s0 tclass=dccp_socket permissive=1 dccp_close: ABORT with 510 bytes unread QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl syz-executor2 (7414): /proc/7408/oom_adj is deprecated, please use /proc/7408/oom_score_adj instead. QAT: Invalid ioctl sg_write: data in/out 1562545402/915 bytes for SCSI command 0x0-- guessing data in; program syz-executor1 not setting count and/or reply_len properly sg_write: data in/out 1562545402/915 bytes for SCSI command 0x0-- guessing data in; program syz-executor1 not setting count and/or reply_len properly audit: type=1400 audit(1518802741.840:40): avc: denied { map } for pid=7604 comm="syz-executor1" path=2F6D656D66643A706F7369785F61636C5F616363657373202864656C6574656429 dev="tmpfs" ino=21970 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:tmpfs_t:s0 tclass=file permissive=1 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium audit: type=1400 audit(1518802741.876:41): avc: denied { ioctl } for pid=7593 comm="syz-executor6" path="socket:[21010]" dev="sockfs" ino=21010 ioctlcmd=0x8906 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 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium audit: type=1400 audit(1518802741.993:42): avc: denied { map } for pid=7622 comm="syz-executor7" path="/dev/sg0" dev="devtmpfs" ino=108 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:scsi_generic_device_t:s0 tclass=chr_file permissive=1 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium binder: 7760:7764 transaction failed 29189/-22, size 0-0 line 2842 binder: undelivered TRANSACTION_ERROR: 29189 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=24 sclass=netlink_tcpdiag_socket pig=7842 comm=syz-executor7 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=24 sclass=netlink_tcpdiag_socket pig=7864 comm=syz-executor7 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium SELinux: unrecognized netlink message: protocol=4 nlmsg_type=24 sclass=netlink_tcpdiag_socket pig=7879 comm=syz-executor7 PPPIOCDETACH file->f_count=2 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium SELinux: unrecognized netlink message: protocol=4 nlmsg_type=24 sclass=netlink_tcpdiag_socket pig=7895 comm=syz-executor7 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=24 sclass=netlink_tcpdiag_socket pig=7918 comm=syz-executor7 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=24 sclass=netlink_tcpdiag_socket pig=7941 comm=syz-executor7 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=24 sclass=netlink_tcpdiag_socket pig=7961 comm=syz-executor1 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=24 sclass=netlink_tcpdiag_socket pig=7963 comm=syz-executor7 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 CPU: 0 PID: 8278 Comm: syz-executor6 Not tainted 4.16.0-rc1+ #315 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:422 [inline] slab_alloc mm/slab.c:3365 [inline] kmem_cache_alloc_trace+0x4b/0x740 mm/slab.c:3605 kmalloc include/linux/slab.h:512 [inline] nfc_genl_rcv_nl_event+0x10c/0x320 net/nfc/netlink.c:1847 notifier_call_chain+0x136/0x2c0 kernel/notifier.c:93 __blocking_notifier_call_chain kernel/notifier.c:317 [inline] blocking_notifier_call_chain+0x102/0x190 kernel/notifier.c:328 netlink_release+0x8ca/0xea0 net/netlink/af_netlink.c:786 sock_release+0x8d/0x1e0 net/socket.c:595 sock_close+0x16/0x20 net/socket.c:1149 __fput+0x327/0x7e0 fs/file_table.c:209 ____fput+0x15/0x20 fs/file_table.c:243 task_work_run+0x199/0x270 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x275/0x2f0 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath arch/x86/entry/common.c:265 [inline] do_syscall_64+0x6e5/0x940 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453a59 RSP: 002b:00007f59907c7c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 00007f59907c86d4 RCX: 0000000000453a59 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000013 RBP: 000000000071bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000014 R13: 0000000000000052 R14: 00000000006f0850 R15: 0000000000000000 audit: type=1400 audit(1518802744.261:43): avc: denied { getopt } for pid=8327 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_generic_socket permissive=1 audit: type=1400 audit(1518802744.291:44): avc: denied { accept } for pid=8327 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_generic_socket permissive=1 QAT: Invalid ioctl