INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. CPU: 1 PID: 18375 Comm: kworker/1:2 Not tainted 4.19.210-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events l2cap_chan_timeout Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 assign_lock_key kernel/locking/lockdep.c:728 [inline] register_lock_class+0xe82/0x11c0 kernel/locking/lockdep.c:754 __lock_acquire+0x17d/0x3ff0 kernel/locking/lockdep.c:3304 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:168 spin_lock_bh include/linux/spinlock.h:334 [inline] lock_sock_nested+0x3b/0x110 net/core/sock.c:2884 l2cap_sock_teardown_cb+0xa0/0x6d0 net/bluetooth/l2cap_sock.c:1348 l2cap_chan_del+0xbc/0xa50 net/bluetooth/l2cap_core.c:603 l2cap_chan_close+0x1b5/0x950 net/bluetooth/l2cap_core.c:761 l2cap_chan_timeout+0x17e/0x2f0 net/bluetooth/l2cap_core.c:430 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 ================================================================== BUG: KASAN: use-after-free in l2cap_sock_teardown_cb+0x628/0x6d0 net/bluetooth/l2cap_sock.c:1350 Read of size 8 at addr ffff8880a103ee20 by task kworker/1:2/18375 CPU: 1 PID: 18375 Comm: kworker/1:2 Not tainted 4.19.210-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events l2cap_chan_timeout Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 l2cap_sock_teardown_cb+0x628/0x6d0 net/bluetooth/l2cap_sock.c:1350 l2cap_chan_del+0xbc/0xa50 net/bluetooth/l2cap_core.c:603 l2cap_chan_close+0x1b5/0x950 net/bluetooth/l2cap_core.c:761 l2cap_chan_timeout+0x17e/0x2f0 net/bluetooth/l2cap_core.c:430 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 11900: __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node+0x4c/0x70 mm/slab.c:3696 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0x61/0xf0 mm/util.c:423 kvmalloc include/linux/mm.h:577 [inline] xt_alloc_table_info+0x3c/0xa0 net/netfilter/x_tables.c:1177 do_replace net/ipv6/netfilter/ip6_tables.c:1145 [inline] do_ip6t_set_ctl+0x214/0x430 net/ipv6/netfilter/ip6_tables.c:1686 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x6f/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x103/0x160 net/ipv6/ipv6_sockglue.c:945 tcp_setsockopt+0x86/0xd0 net/ipv4/tcp.c:3108 __sys_setsockopt+0x14d/0x240 net/socket.c:2013 __do_sys_setsockopt net/socket.c:2024 [inline] __se_sys_setsockopt net/socket.c:2021 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2021 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11900: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 kvfree+0x59/0x60 mm/util.c:452 __do_replace+0x6ab/0x870 net/ipv6/netfilter/ip6_tables.c:1107 do_replace net/ipv6/netfilter/ip6_tables.c:1160 [inline] do_ip6t_set_ctl+0x2d2/0x430 net/ipv6/netfilter/ip6_tables.c:1686 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x6f/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x103/0x160 net/ipv6/ipv6_sockglue.c:945 tcp_setsockopt+0x86/0xd0 net/ipv4/tcp.c:3108 __sys_setsockopt+0x14d/0x240 net/socket.c:2013 __do_sys_setsockopt net/socket.c:2024 [inline] __se_sys_setsockopt net/socket.c:2021 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2021 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a103e980 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1184 bytes inside of 2048-byte region [ffff8880a103e980, ffff8880a103f180) The buggy address belongs to the page: page:ffffea0002840f80 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0xffff8880a103f200 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0000ff4c08 ffffea000122b088 ffff88813bff0c40 raw: ffff8880a103f200 ffff8880a103e100 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a103ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a103ed80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a103ee00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a103ee80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a103ef00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================