================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1495 Read of size 2 at addr ffff8880202f9808 by task kworker/u5:6/3665 CPU: 1 PID: 3665 Comm: kworker/u5:6 Not tainted 6.0.0-syzkaller-09589-g55be6084c8e0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: hci6 hci_cmd_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1495 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 985: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:525 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1265 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:469 [inline] hci_cmd_sync_alloc net/bluetooth/hci_sync.c:54 [inline] hci_cmd_sync_add net/bluetooth/hci_sync.c:95 [inline] __hci_cmd_sync_sk+0x568/0xe20 net/bluetooth/hci_sync.c:157 __hci_cmd_sync+0x34/0x40 net/bluetooth/hci_sync.c:206 btintel_enter_mfg+0x2c/0xb0 drivers/bluetooth/btintel.c:79 ag6xx_setup+0xfc/0x860 drivers/bluetooth/hci_ag6xx.c:165 hci_uart_setup+0x1b1/0x480 drivers/bluetooth/hci_ldisc.c:423 hci_dev_setup_sync net/bluetooth/hci_sync.c:4490 [inline] hci_dev_init_sync net/bluetooth/hci_sync.c:4566 [inline] hci_dev_open_sync+0x357/0x21a0 net/bluetooth/hci_sync.c:4664 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xda/0x620 net/bluetooth/hci_core.c:984 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 985: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x13d/0x1a0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3418 [inline] kfree+0x173/0x390 mm/slab.c:3786 skb_free_head+0xac/0x110 net/core/skbuff.c:760 skb_release_data+0x5f1/0x870 net/core/skbuff.c:789 skb_release_all net/core/skbuff.c:854 [inline] __kfree_skb net/core/skbuff.c:868 [inline] kfree_skb_reason+0x14e/0x410 net/core/skbuff.c:891 kfree_skb include/linux/skbuff.h:1214 [inline] hci_dev_open_sync+0xbec/0x21a0 net/bluetooth/hci_sync.c:4699 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xda/0x620 net/bluetooth/hci_core.c:984 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x625/0x1200 kernel/workqueue.c:1517 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1d0/0x9c8 kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x625/0x1200 kernel/workqueue.c:1517 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1d0/0x9c8 kernel/softirq.c:571 The buggy address belongs to the object at ffff8880202f9800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff8880202f9800, ffff8880202f9a00) The buggy address belongs to the physical page: page:ffffea000080be40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880202f9000 pfn:0x202f9 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000a6eec8 ffffea0000a2e188 ffff888011840600 raw: ffff8880202f9000 ffff8880202f9000 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 3651, tgid 3651 (syz-executor.4), ts 233873656482, free_ts 233843067749 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549 __alloc_pages_node include/linux/gfp.h:243 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] __do_cache_alloc mm/slab.c:3246 [inline] slab_alloc mm/slab.c:3287 [inline] kmem_cache_alloc_trace+0x362/0x460 mm/slab.c:3557 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] fib6_info_alloc+0xc1/0x210 net/ipv6/ip6_fib.c:156 ip6_route_info_create+0x341/0x18f0 net/ipv6/route.c:3749 ip6_route_add+0x24/0x150 net/ipv6/route.c:3843 addrconf_prefix_route+0x30a/0x4e0 net/ipv6/addrconf.c:2425 inet6_addr_add+0x71d/0xae0 net/ipv6/addrconf.c:2972 inet6_rtm_newaddr+0xfa4/0x1a60 net/ipv6/addrconf.c:4927 rtnetlink_rcv_msg+0x43a/0xca0 net/core/rtnetlink.c:6091 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2540 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1635 cache_flusharray mm/slab.c:3389 [inline] ___cache_free+0x2a8/0x3d0 mm/slab.c:3452 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc mm/slab.c:3294 [inline] kmem_cache_alloc_trace+0x212/0x460 mm/slab.c:3557 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] mca_alloc net/ipv6/mcast.c:880 [inline] __ipv6_dev_mc_inc+0x3de/0xec0 net/ipv6/mcast.c:936 addrconf_join_solict net/ipv6/addrconf.c:2180 [inline] addrconf_join_solict net/ipv6/addrconf.c:2172 [inline] addrconf_dad_begin net/ipv6/addrconf.c:3991 [inline] addrconf_dad_work+0xc56/0x12d0 net/ipv6/addrconf.c:4116 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff8880202f9700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880202f9780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880202f9800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880202f9880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880202f9900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================