================================================================== BUG: KASAN: slab-use-after-free in l2cap_connect.constprop.0+0x10d8/0x1270 net/bluetooth/l2cap_core.c:3949 Read of size 8 at addr ffff888024fc0800 by task kworker/u9:5/6007 CPU: 0 UID: 0 PID: 6007 Comm: kworker/u9:5 Not tainted 6.11.0-syzkaller-07462-g1868f9d0260e-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 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 l2cap_connect.constprop.0+0x10d8/0x1270 net/bluetooth/l2cap_core.c:3949 l2cap_connect_req net/bluetooth/l2cap_core.c:4080 [inline] l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:4772 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:5543 [inline] l2cap_recv_frame+0xf0b/0x8eb0 net/bluetooth/l2cap_core.c:6825 l2cap_recv_acldata+0x9b4/0xb70 net/bluetooth/l2cap_core.c:7514 hci_acldata_packet net/bluetooth/hci_core.c:3791 [inline] hci_rx_work+0xaab/0x1610 net/bluetooth/hci_core.c:4028 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 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 6007: 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:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1004 [inline] l2cap_conn_add.part.0+0x60/0xa60 net/bluetooth/l2cap_core.c:6868 l2cap_conn_add net/bluetooth/l2cap_core.c:69 [inline] l2cap_connect_cfm+0x428/0xf80 net/bluetooth/l2cap_core.c:7245 hci_connect_cfm include/net/bluetooth/hci_core.h:1960 [inline] hci_remote_features_evt+0x548/0x9e0 net/bluetooth/hci_event.c:3721 hci_event_func net/bluetooth/hci_event.c:7446 [inline] hci_event_packet+0x9eb/0x1180 net/bluetooth/hci_event.c:7498 hci_rx_work+0x2c6/0x1610 net/bluetooth/hci_core.c:4023 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 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 7346: 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:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2343 [inline] slab_free mm/slub.c:4580 [inline] kfree+0x158/0x4b0 mm/slub.c:4728 l2cap_conn_free net/bluetooth/l2cap_core.c:1810 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_conn_put net/bluetooth/l2cap_core.c:1822 [inline] l2cap_conn_del+0x59d/0x730 net/bluetooth/l2cap_core.c:1802 l2cap_connect_cfm+0x9e6/0xf80 net/bluetooth/l2cap_core.c:7241 hci_connect_cfm include/net/bluetooth/hci_core.h:1960 [inline] hci_conn_failed+0x1c3/0x340 net/bluetooth/hci_conn.c:1262 hci_abort_conn_sync+0x75a/0xb50 net/bluetooth/hci_sync.c:5586 abort_conn_sync+0x197/0x360 net/bluetooth/hci_conn.c:2914 hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:328 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 insert_work+0x36/0x230 kernel/workqueue.c:2183 __queue_work+0x97e/0x1070 kernel/workqueue.c:2339 call_timer_fn+0x1a0/0x610 kernel/time/timer.c:1794 expire_timers kernel/time/timer.c:1840 [inline] __run_timers+0x567/0xaf0 kernel/time/timer.c:2419 __run_timer_base kernel/time/timer.c:2430 [inline] __run_timer_base kernel/time/timer.c:2423 [inline] run_timer_base+0x111/0x190 kernel/time/timer.c:2439 run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2449 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554 run_ksoftirqd kernel/softirq.c:927 [inline] run_ksoftirqd+0x3a/0x60 kernel/softirq.c:919 smpboot_thread_fn+0x661/0xa10 kernel/smpboot.c:164 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Second to last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 insert_work+0x36/0x230 kernel/workqueue.c:2183 __queue_work+0x3f8/0x1070 kernel/workqueue.c:2343 queue_work_on+0x11a/0x140 kernel/workqueue.c:2390 queue_work include/linux/workqueue.h:662 [inline] l2cap_conn_ready net/bluetooth/l2cap_core.c:1640 [inline] l2cap_connect_cfm+0x9c9/0xf80 net/bluetooth/l2cap_core.c:7286 hci_connect_cfm include/net/bluetooth/hci_core.h:1960 [inline] hci_remote_features_evt+0x548/0x9e0 net/bluetooth/hci_event.c:3721 hci_event_func net/bluetooth/hci_event.c:7446 [inline] hci_event_packet+0x9eb/0x1180 net/bluetooth/hci_event.c:7498 hci_rx_work+0x2c6/0x1610 net/bluetooth/hci_core.c:4023 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 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 ffff888024fc0800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes inside of freed 1024-byte region [ffff888024fc0800, ffff888024fc0c00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24fc0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff88801ac41dc0 ffffea000184b800 dead000000000002 raw: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000 head: 00fff00000000040 ffff88801ac41dc0 ffffea000184b800 dead000000000002 head: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000 head: 00fff00000000003 ffffea000093f001 ffffffffffffffff 0000000000000000 head: 0000000000000008 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 5990, tgid 5990 (syz-executor), ts 135657745907, free_ts 135104533114 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446 __alloc_pages_noprof+0x22b/0x23f0 mm/page_alloc.c:4702 alloc_pages_mpol_noprof+0x275/0x610 mm/mempolicy.c:2263 alloc_slab_page mm/slub.c:2413 [inline] allocate_slab mm/slub.c:2579 [inline] new_slab+0x28c/0x3f0 mm/slub.c:2632 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3819 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3909 __slab_alloc_node mm/slub.c:3962 [inline] slab_alloc_node mm/slub.c:4123 [inline] __do_kmalloc_node mm/slub.c:4264 [inline] __kmalloc_node_noprof+0x357/0x430 mm/slub.c:4271 __kvmalloc_node_noprof+0x9d/0x1a0 mm/util.c:650 bucket_table_alloc.isra.0+0x86/0x470 lib/rhashtable.c:186 rhashtable_init_noprof+0x41a/0x7e0 lib/rhashtable.c:1071 ipc_init_ids+0x92/0x280 ipc/util.c:120 create_ipc_ns ipc/namespace.c:89 [inline] copy_ipcs+0x4e5/0x600 ipc/namespace.c:112 create_new_namespaces+0x20a/0xad0 kernel/nsproxy.c:90 unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x419/0x970 kernel/fork.c:3308 page last free pid 1191 tgid 1191 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1101 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619 __put_partials+0x14c/0x170 mm/slub.c:3146 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4086 [inline] slab_alloc_node mm/slub.c:4135 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4187 __alloc_skb+0x2b1/0x380 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1322 [inline] alloc_skb_with_frags+0xe4/0x850 net/core/skbuff.c:6612 sock_alloc_send_pskb+0x7f1/0x980 net/core/sock.c:2883 sock_alloc_send_skb include/net/sock.h:1780 [inline] mld_newpack.isra.0+0x1ed/0x790 net/ipv6/mcast.c:1747 add_grhead+0x299/0x340 net/ipv6/mcast.c:1850 add_grec+0x111e/0x1670 net/ipv6/mcast.c:1988 mld_send_cr net/ipv6/mcast.c:2114 [inline] mld_ifc_work+0x41f/0xca0 net/ipv6/mcast.c:2651 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 Memory state around the buggy address: ffff888024fc0700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888024fc0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888024fc0800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888024fc0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888024fc0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================