BUG: sleeping function called from invalid context at kernel/locking/mutex.c:585 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 5208, name: kworker/u33:5 preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 4 locks held by kworker/u33:5/5208: #0: ffff888029b6c148 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work+0x1296/0x1ac0 kernel/workqueue.c:3229 #1: ffffc900033d7d80 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x906/0x1ac0 kernel/workqueue.c:3230 #2: ffff88804379c078 (&hdev->lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0xde/0xb30 net/bluetooth/hci_event.c:6939 #3: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #3: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #3: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: hci_le_create_big_complete_evt+0x100/0xb30 net/bluetooth/hci_event.c:6940 CPU: 3 PID: 5208 Comm: kworker/u33:5 Not tainted 6.9.0-rc4-syzkaller-00031-g96fca68c4fbf #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x16c/0x1f0 lib/dump_stack.c:114 __might_resched+0x3c0/0x5e0 kernel/sched/core.c:10197 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0xe2/0x9c0 kernel/locking/mutex.c:752 hci_connect_cfm include/net/bluetooth/hci_core.h:2004 [inline] hci_le_create_big_complete_evt+0x387/0xb30 net/bluetooth/hci_event.c:6964 hci_le_meta_evt+0x2e2/0x5d0 net/bluetooth/hci_event.c:7228 hci_event_func net/bluetooth/hci_event.c:7539 [inline] hci_event_packet+0x664/0x1170 net/bluetooth/hci_event.c:7594 hci_rx_work+0x2c4/0x1610 net/bluetooth/hci_core.c:4171 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 ============================= [ BUG: Invalid wait context ] 6.9.0-rc4-syzkaller-00031-g96fca68c4fbf #0 Tainted: G W ----------------------------- kworker/u33:5/5208 is trying to lock: ffffffff8f55d248 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:2004 [inline] ffffffff8f55d248 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0x387/0xb30 net/bluetooth/hci_event.c:6964 other info that might help us debug this: context-{4:4} 4 locks held by kworker/u33:5/5208: #0: ffff888029b6c148 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work+0x1296/0x1ac0 kernel/workqueue.c:3229 #1: ffffc900033d7d80 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x906/0x1ac0 kernel/workqueue.c:3230 #2: ffff88804379c078 (&hdev->lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0xde/0xb30 net/bluetooth/hci_event.c:6939 #3: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #3: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #3: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: hci_le_create_big_complete_evt+0x100/0xb30 net/bluetooth/hci_event.c:6940 stack backtrace: CPU: 3 PID: 5208 Comm: kworker/u33:5 Tainted: G W 6.9.0-rc4-syzkaller-00031-g96fca68c4fbf #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_lock_invalid_wait_context kernel/locking/lockdep.c:4751 [inline] check_wait_context kernel/locking/lockdep.c:4821 [inline] __lock_acquire+0x811/0x3b30 kernel/locking/lockdep.c:5087 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hci_connect_cfm include/net/bluetooth/hci_core.h:2004 [inline] hci_le_create_big_complete_evt+0x387/0xb30 net/bluetooth/hci_event.c:6964 hci_le_meta_evt+0x2e2/0x5d0 net/bluetooth/hci_event.c:7228 hci_event_func net/bluetooth/hci_event.c:7539 [inline] hci_event_packet+0x664/0x1170 net/bluetooth/hci_event.c:7594 hci_rx_work+0x2c4/0x1610 net/bluetooth/hci_core.c:4171 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 ================================================================== BUG: KASAN: slab-use-after-free in hci_le_create_big_complete_evt+0xa62/0xb30 net/bluetooth/hci_event.c:6943 Read of size 8 at addr ffff888045258000 by task kworker/u33:5/5208 CPU: 3 PID: 5208 Comm: kworker/u33:5 Tainted: G W 6.9.0-rc4-syzkaller-00031-g96fca68c4fbf #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 hci_le_create_big_complete_evt+0xa62/0xb30 net/bluetooth/hci_event.c:6943 hci_le_meta_evt+0x2e2/0x5d0 net/bluetooth/hci_event.c:7228 hci_event_func net/bluetooth/hci_event.c:7539 [inline] hci_event_packet+0x664/0x1170 net/bluetooth/hci_event.c:7594 hci_rx_work+0x2c4/0x1610 net/bluetooth/hci_core.c:4171 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 5208: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] hci_conn_add+0xb9/0x1620 net/bluetooth/hci_conn.c:914 hci_le_big_sync_established_evt+0x7e3/0xa30 net/bluetooth/hci_event.c:7005 hci_le_meta_evt+0x2e2/0x5d0 net/bluetooth/hci_event.c:7228 hci_event_func net/bluetooth/hci_event.c:7539 [inline] hci_event_packet+0x664/0x1170 net/bluetooth/hci_event.c:7594 hci_rx_work+0x2c4/0x1610 net/bluetooth/hci_core.c:4171 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 5208: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0x129/0x390 mm/slub.c:4390 device_release+0xa1/0x240 drivers/base/core.c:2580 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1fa/0x5b0 lib/kobject.c:737 put_device+0x1f/0x30 drivers/base/core.c:3828 hci_conn_del_sysfs+0x151/0x180 net/bluetooth/hci_sysfs.c:72 hci_conn_cleanup net/bluetooth/hci_conn.c:176 [inline] hci_conn_del+0x558/0xe00 net/bluetooth/hci_conn.c:1126 hci_le_create_big_complete_evt+0x4ba/0xb30 net/bluetooth/hci_event.c:6966 hci_le_meta_evt+0x2e2/0x5d0 net/bluetooth/hci_event.c:7228 hci_event_func net/bluetooth/hci_event.c:7539 [inline] hci_event_packet+0x664/0x1170 net/bluetooth/hci_event.c:7594 hci_rx_work+0x2c4/0x1610 net/bluetooth/hci_core.c:4171 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff888045258000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 0 bytes inside of freed 8192-byte region [ffff888045258000, ffff88804525a000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x45258 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000840 ffff888015043180 ffffea0000f49800 0000000000000005 raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000 head: 00fff80000000840 ffff888015043180 ffffea0000f49800 0000000000000005 head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000 head: 00fff80000000003 ffffea0001149601 ffffea0001149648 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5211, tgid 5211 (syz-executor.0), ts 53345124647, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x66d/0x1790 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmalloc_trace+0x2fb/0x330 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] mr_table_alloc+0x5f/0x2e0 net/ipv4/ipmr_base.c:41 ip6mr_new_table net/ipv6/ip6mr.c:389 [inline] ip6mr_new_table net/ipv6/ip6mr.c:381 [inline] ip6mr_rules_init net/ipv6/ip6mr.c:239 [inline] ip6mr_net_init net/ipv6/ip6mr.c:1318 [inline] ip6mr_net_init+0x3c4/0x500 net/ipv6/ip6mr.c:1310 ops_init+0xb9/0x650 net/core/net_namespace.c:136 setup_net+0x435/0xb40 net/core/net_namespace.c:340 copy_net_ns+0x2f0/0x670 net/core/net_namespace.c:505 create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x419/0x970 kernel/fork.c:3322 __do_sys_unshare kernel/fork.c:3393 [inline] __se_sys_unshare kernel/fork.c:3391 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3391 page_owner free stack trace missing Memory state around the buggy address: ffff888045257f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888045257f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888045258000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888045258080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888045258100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================