Bluetooth: Unknown BR/EDR signaling command 0x0f Bluetooth: Wrong link type (-22) Bluetooth: Unknown BR/EDR signaling command 0x11 Bluetooth: Wrong link type (-22) ================================================================== BUG: KASAN: slab-use-after-free in l2cap_build_cmd net/bluetooth/l2cap_core.c:2924 [inline] BUG: KASAN: slab-use-after-free in l2cap_send_cmd+0x5ec/0x8d0 net/bluetooth/l2cap_core.c:927 Read of size 4 at addr ffff888014e8d810 by task kworker/u5:9/4761 CPU: 0 PID: 4761 Comm: kworker/u5:9 Not tainted 6.8.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xf8/0x260 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0x167/0x540 mm/kasan/report.c:488 kasan_report+0x142/0x180 mm/kasan/report.c:601 l2cap_build_cmd net/bluetooth/l2cap_core.c:2924 [inline] l2cap_send_cmd+0x5ec/0x8d0 net/bluetooth/l2cap_core.c:927 l2cap_sig_send_rej net/bluetooth/l2cap_core.c:5501 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:5537 [inline] l2cap_recv_frame+0x1a0f/0xeba0 net/bluetooth/l2cap_core.c:6794 hci_acldata_packet net/bluetooth/hci_core.c:3926 [inline] hci_rx_work+0x678/0xc50 net/bluetooth/hci_core.c:4161 process_one_work kernel/workqueue.c:2633 [inline] process_scheduled_works+0x7e9/0xfd0 kernel/workqueue.c:2706 worker_thread+0x868/0xca0 kernel/workqueue.c:2787 kthread+0x267/0x2c0 kernel/kthread.c:388 ret_from_fork+0x32/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243 Allocated by task 2742: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace+0x1c4/0x3a0 mm/slub.c:4012 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:711 [inline] l2cap_conn_add+0x9c/0x8f0 net/bluetooth/l2cap_core.c:6837 l2cap_connect_cfm+0x182/0xfb0 net/bluetooth/l2cap_core.c:7230 hci_connect_cfm include/net/bluetooth/hci_core.h:1986 [inline] hci_remote_features_evt+0x5c6/0xb50 net/bluetooth/hci_event.c:3766 hci_event_func net/bluetooth/hci_event.c:7685 [inline] hci_event_packet+0x923/0x1200 net/bluetooth/hci_event.c:7737 hci_rx_work+0x39f/0xc50 net/bluetooth/hci_core.c:4156 process_one_work kernel/workqueue.c:2633 [inline] process_scheduled_works+0x7e9/0xfd0 kernel/workqueue.c:2706 worker_thread+0x868/0xca0 kernel/workqueue.c:2787 kthread+0x267/0x2c0 kernel/kthread.c:388 ret_from_fork+0x32/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243 Freed by task 47: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:589 poison_slab_object+0xee/0x1a0 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kfree+0x139/0x350 mm/slub.c:4409 l2cap_connect_cfm+0xe3/0xfb0 net/bluetooth/l2cap_core.c:7226 hci_connect_cfm include/net/bluetooth/hci_core.h:1986 [inline] hci_conn_failed+0x1ad/0x2c0 net/bluetooth/hci_conn.c:1285 hci_abort_conn_sync+0x2d3/0xb30 net/bluetooth/hci_sync.c:5361 hci_cmd_sync_work+0x210/0x3a0 net/bluetooth/hci_sync.c:306 process_one_work kernel/workqueue.c:2633 [inline] process_scheduled_works+0x7e9/0xfd0 kernel/workqueue.c:2706 worker_thread+0x868/0xca0 kernel/workqueue.c:2787 kthread+0x267/0x2c0 kernel/kthread.c:388 ret_from_fork+0x32/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:551 insert_work+0x38/0x230 kernel/workqueue.c:1653 __queue_work+0x81f/0xa70 kernel/workqueue.c:1802 call_timer_fn+0x126/0x320 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x4c8/0x590 kernel/time/timer.c:2038 run_timer_softirq+0x45/0x80 kernel/time/timer.c:2051 __do_softirq+0x1be/0x586 kernel/softirq.c:553 Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:551 insert_work+0x38/0x230 kernel/workqueue.c:1653 __queue_work+0x867/0xa70 kernel/workqueue.c:1806 queue_work_on+0xf7/0x1a0 kernel/workqueue.c:1837 queue_work include/linux/workqueue.h:548 [inline] l2cap_conn_ready net/bluetooth/l2cap_core.c:1613 [inline] l2cap_connect_cfm+0xcce/0xfb0 net/bluetooth/l2cap_core.c:7271 hci_connect_cfm include/net/bluetooth/hci_core.h:1986 [inline] hci_remote_features_evt+0x5c6/0xb50 net/bluetooth/hci_event.c:3766 hci_event_func net/bluetooth/hci_event.c:7685 [inline] hci_event_packet+0x923/0x1200 net/bluetooth/hci_event.c:7737 hci_rx_work+0x39f/0xc50 net/bluetooth/hci_core.c:4156 process_one_work kernel/workqueue.c:2633 [inline] process_scheduled_works+0x7e9/0xfd0 kernel/workqueue.c:2706 worker_thread+0x868/0xca0 kernel/workqueue.c:2787 kthread+0x267/0x2c0 kernel/kthread.c:388 ret_from_fork+0x32/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243 The buggy address belongs to the object at ffff888014e8d800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 16 bytes inside of freed 1024-byte region [ffff888014e8d800, ffff888014e8dc00) The buggy address belongs to the physical page: page:ffffea000053a200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888014e8b000 pfn:0x14e88 head:ffffea000053a200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000a40(workingset|slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000a40 ffff888010c41dc0 ffffea0000775c10 ffffea00005ba010 raw: ffff888014e8b000 000000000010000e 00000001ffffffff 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 1, tgid 1 (swapper/0), ts 2160446339, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x10f/0x130 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x345c/0x3600 mm/page_alloc.c:3311 __alloc_pages+0x255/0x650 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2190 allocate_slab mm/slub.c:2354 [inline] new_slab+0x70/0x270 mm/slub.c:2407 ___slab_alloc+0xa79/0x10b0 mm/slub.c:3540 __slab_alloc mm/slub.c:3625 [inline] __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] __do_kmalloc_node mm/slub.c:3980 [inline] __kmalloc_node+0x2b5/0x4c0 mm/slub.c:3988 kmalloc_node include/linux/slab.h:610 [inline] kvmalloc_node+0x42/0xf0 mm/util.c:617 kvmalloc include/linux/slab.h:728 [inline] kvzalloc include/linux/slab.h:736 [inline] bucket_table_alloc lib/rhashtable.c:184 [inline] rhashtable_init+0x3cd/0x960 lib/rhashtable.c:1065 netlink_proto_init+0x75/0x120 net/netlink/af_netlink.c:2942 do_one_initcall+0x196/0x4d0 init/main.c:1236 do_initcall_level+0x11e/0x1e0 init/main.c:1298 do_initcalls+0x3e/0x70 init/main.c:1314 kernel_init_freeable+0x364/0x4c0 init/main.c:1551 kernel_init+0x18/0x1a0 init/main.c:1441 ret_from_fork+0x32/0x60 arch/x86/kernel/process.c:147 page_owner free stack trace missing Memory state around the buggy address: ffff888014e8d700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888014e8d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888014e8d800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888014e8d880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888014e8d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================