================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x24f/0x260 net/bluetooth/hci_core.c:1495 Read of size 2 at addr ffff88807e452408 by task kworker/u5:4/3679 CPU: 0 PID: 3679 Comm: kworker/u5:4 Not tainted 6.1.0-rc8-syzkaller-00018-g479174d402bc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: hci8 hci_cmd_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x461 mm/kasan/report.c:395 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495 hci_cmd_timeout+0x24f/0x260 net/bluetooth/hci_core.c:1495 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3681: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc_node_track_caller+0x5b/0xc0 mm/slab_common.c:975 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0xdd/0x300 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1267 [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+0x56c/0xe30 net/bluetooth/hci_sync.c:157 __hci_cmd_sync+0x38/0x50 net/bluetooth/hci_sync.c:206 btintel_enter_mfg+0x30/0xc0 drivers/bluetooth/btintel.c:79 ag6xx_setup+0x100/0x860 drivers/bluetooth/hci_ag6xx.c:165 hci_uart_setup+0x1b5/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+0x35b/0x21a0 net/bluetooth/hci_sync.c:4664 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xde/0x620 net/bluetooth/hci_core.c:984 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 3681: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13b/0x1a0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] __cache_free mm/slab.c:3389 [inline] __do_kmem_cache_free mm/slab.c:3585 [inline] __kmem_cache_free+0xcd/0x3b0 mm/slab.c:3592 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+0x18a/0x4b0 net/core/skbuff.c:891 kfree_skb include/linux/skbuff.h:1216 [inline] hci_dev_open_sync+0xbf0/0x21a0 net/bluetooth/hci_sync.c:4699 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xde/0x620 net/bluetooth/hci_core.c:984 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff88807e452400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88807e452400, ffff88807e452600) The buggy address belongs to the physical page: page:ffffea0001f91480 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e452 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001d341c8 ffffea000086c7c8 ffff888012040600 raw: 0000000000000000 ffff88807e452000 0000000100000004 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 0x3c20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE), pid 6630, tgid 6624 (syz-executor.5), ts 412774198104, free_ts 412703372358 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4291 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5558 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x94/0x390 mm/slab.c:2570 cache_alloc_refill+0x27f/0x380 mm/slab.c:2943 ____cache_alloc mm/slab.c:3019 [inline] ____cache_alloc mm/slab.c:3002 [inline] __do_cache_alloc mm/slab.c:3202 [inline] slab_alloc_node mm/slab.c:3250 [inline] __kmem_cache_alloc_node+0x44a/0x510 mm/slab.c:3549 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node_track_caller+0x4b/0xc0 mm/slab_common.c:975 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0xdd/0x300 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1267 [inline] __ip6_append_data.isra.0+0x3162/0x43d0 net/ipv6/ip6_output.c:1679 ip6_append_data+0x1ee/0x550 net/ipv6/ip6_output.c:1849 rawv6_sendmsg+0x1520/0x3b50 net/ipv6/raw.c:915 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:827 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x334/0x8c0 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmmsg+0x18f/0x460 net/socket.c:2622 __do_sys_sendmmsg net/socket.c:2651 [inline] __se_sys_sendmmsg net/socket.c:2648 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2648 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3483 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1635 drain_array+0x93/0xa0 mm/slab.c:3822 cache_reap+0x18b/0x2e0 mm/slab.c:3871 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff88807e452300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807e452380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807e452400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807e452480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807e452500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================