================================================================== BUG: KASAN: slab-use-after-free in hci_send_acl+0x54/0xc48 net/bluetooth/hci_core.c:3231 Read of size 8 at addr ffff0000d1f94618 by task kworker/0:5/6196 CPU: 0 PID: 6196 Comm: kworker/0:5 Not tainted 6.6.0-rc7-syzkaller-g8de1e7afcc1c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Workqueue: events l2cap_info_timeout Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x174/0x514 mm/kasan/report.c:475 kasan_report+0xd8/0x138 mm/kasan/report.c:588 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 hci_send_acl+0x54/0xc48 net/bluetooth/hci_core.c:3231 l2cap_send_cmd+0x52c/0x76c net/bluetooth/l2cap_core.c:977 l2cap_send_conn_req+0x188/0x2c4 net/bluetooth/l2cap_core.c:1286 l2cap_start_connection+0x118/0x2fc net/bluetooth/l2cap_core.c:1514 l2cap_conn_start+0x928/0xd8c net/bluetooth/l2cap_core.c:1661 l2cap_info_timeout+0x68/0xb8 net/bluetooth/l2cap_core.c:1807 process_one_work+0x694/0x1204 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:2784 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:857 Allocated by task 17744: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:511 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] kmalloc_trace+0x70/0x88 mm/slab_common.c:1122 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] hci_chan_create+0xb0/0x2b0 net/bluetooth/hci_conn.c:2723 l2cap_conn_add+0x78/0x998 net/bluetooth/l2cap_core.c:7841 l2cap_chan_connect+0x5bc/0xce4 net/bluetooth/l2cap_core.c:8053 l2cap_sock_connect+0x478/0x6c8 net/bluetooth/l2cap_sock.c:256 kernel_connect+0x114/0x164 net/socket.c:3599 rfcomm_session_create net/bluetooth/rfcomm/core.c:811 [inline] __rfcomm_dlc_open net/bluetooth/rfcomm/core.c:388 [inline] rfcomm_dlc_open+0x610/0xef0 net/bluetooth/rfcomm/core.c:431 rfcomm_sock_connect+0x260/0x59c net/bluetooth/rfcomm/sock.c:409 __sys_connect_file net/socket.c:2050 [inline] __sys_connect+0x268/0x290 net/socket.c:2067 __do_sys_connect net/socket.c:2077 [inline] __se_sys_connect net/socket.c:2074 [inline] __arm64_sys_connect+0x7c/0x94 net/socket.c:2074 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x54/0x158 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 Freed by task 6132: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:522 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0x2ac/0x480 mm/slub.c:3822 kfree+0xb8/0x19c mm/slab_common.c:1075 hci_chan_del+0x148/0x1c4 net/bluetooth/hci_conn.c:2753 hci_chan_list_flush net/bluetooth/hci_conn.c:2763 [inline] hci_conn_cleanup net/bluetooth/hci_conn.c:152 [inline] hci_conn_del+0x3cc/0xabc net/bluetooth/hci_conn.c:1156 hci_conn_failed+0x204/0x2c0 net/bluetooth/hci_conn.c:1252 hci_abort_conn_sync+0x688/0xe38 net/bluetooth/hci_sync.c:5428 abort_conn_sync+0x5c/0x8c net/bluetooth/hci_conn.c:2910 hci_cmd_sync_work+0x1cc/0x34c net/bluetooth/hci_sync.c:306 process_one_work+0x694/0x1204 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:2784 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:857 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:492 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:502 insert_work+0x54/0x2d4 kernel/workqueue.c:1647 __queue_work+0xcf4/0x1338 kernel/workqueue.c:1799 queue_work_on+0x9c/0x128 kernel/workqueue.c:1834 queue_work include/linux/workqueue.h:554 [inline] schedule_work include/linux/workqueue.h:615 [inline] rt6_probe net/ipv6/route.c:667 [inline] find_match+0x958/0xae4 net/ipv6/route.c:756 __find_rr_leaf+0x238/0x724 net/ipv6/route.c:830 find_rr_leaf net/ipv6/route.c:851 [inline] rt6_select net/ipv6/route.c:895 [inline] fib6_table_lookup+0x36c/0x9c0 net/ipv6/route.c:2183 ip6_pol_route+0x224/0x127c net/ipv6/route.c:2219 ip6_pol_route_output+0x70/0x94 net/ipv6/route.c:2594 pol_lookup_func include/net/ip6_fib.h:614 [inline] fib6_rule_lookup+0x2dc/0x510 net/ipv6/fib6_rules.c:121 ip6_route_output_flags_noref net/ipv6/route.c:2627 [inline] ip6_route_output_flags+0x2f0/0x58c net/ipv6/route.c:2639 ip6_route_output include/net/ip6_route.h:94 [inline] ip6_dst_lookup_tail+0x160/0x109c net/ipv6/ip6_output.c:1110 ip6_dst_lookup_flow+0xb8/0x174 net/ipv6/ip6_output.c:1240 geneve_get_v6_dst+0x3d8/0x97c drivers/net/geneve.c:881 geneve6_xmit_skb drivers/net/geneve.c:1016 [inline] geneve_xmit+0xaa8/0x3550 drivers/net/geneve.c:1100 __netdev_start_xmit include/linux/netdevice.h:4889 [inline] netdev_start_xmit include/linux/netdevice.h:4903 [inline] xmit_one net/core/dev.c:3573 [inline] dev_hard_start_xmit+0x240/0x8ac net/core/dev.c:3589 __dev_queue_xmit+0x1650/0x32c0 net/core/dev.c:4369 dev_queue_xmit include/linux/netdevice.h:3082 [inline] neigh_resolve_output+0x518/0x618 net/core/neighbour.c:1554 neigh_output include/net/neighbour.h:542 [inline] ip6_finish_output2+0xd60/0x1a1c net/ipv6/ip6_output.c:135 __ip6_finish_output net/ipv6/ip6_output.c:196 [inline] ip6_finish_output+0x538/0x93c net/ipv6/ip6_output.c:207 NF_HOOK_COND include/linux/netfilter.h:293 [inline] ip6_output+0x270/0x594 net/ipv6/ip6_output.c:228 dst_output include/net/dst.h:458 [inline] NF_HOOK include/linux/netfilter.h:304 [inline] ndisc_send_skb+0xc30/0x1790 net/ipv6/ndisc.c:509 ndisc_send_rs+0x47c/0x5d4 net/ipv6/ndisc.c:719 addrconf_rs_timer+0x300/0x58c net/ipv6/addrconf.c:3973 call_timer_fn+0x19c/0x8cc kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x55c/0x734 kernel/time/timer.c:2022 run_timer_softirq+0x7c/0x114 kernel/time/timer.c:2035 __do_softirq+0x2d0/0xd54 kernel/softirq.c:553 Second to last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:492 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:502 kvfree_call_rcu+0xac/0x674 kernel/rcu/tree.c:3372 kernfs_unlink_open_file+0x398/0x448 fs/kernfs/file.c:633 kernfs_fop_release+0x130/0x198 fs/kernfs/file.c:805 __fput+0x324/0x7f8 fs/file_table.c:384 __fput_sync+0x60/0x9c fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __arm64_sys_close+0x150/0x1e0 fs/open.c:1557 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x54/0x158 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 The buggy address belongs to the object at ffff0000d1f94600 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of freed 128-byte region [ffff0000d1f94600, ffff0000d1f94680) The buggy address belongs to the physical page: page:00000000e4994c0f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x111f94 anon flags: 0x5ffc00000000800(slab|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000800 ffff0000c00018c0 fffffc0003694ac0 dead000000000005 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d1f94500: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff0000d1f94580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000d1f94600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d1f94680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d1f94700: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ==================================================================