================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x1b5/0x1e0 net/bluetooth/hci_core.c:1474 Read of size 2 at addr ffff88804a15f408 by task kworker/0:4/3687 CPU: 0 PID: 3687 Comm: kworker/0:4 Not tainted 5.18.0-syzkaller-13760-g032dcf09e2bf #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events hci_cmd_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:313 print_report+0xf4/0x210 mm/kasan/report.c:429 kasan_report+0xfb/0x130 mm/kasan/report.c:491 hci_cmd_timeout+0x1b5/0x1e0 net/bluetooth/hci_core.c:1474 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 Allocated by task 3862: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:515 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace+0x94/0x310 mm/slub.c:3255 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] kernfs_fop_open+0x3ab/0xb60 fs/kernfs/file.c:621 do_dentry_open+0x789/0x1040 fs/open.c:848 do_open fs/namei.c:3527 [inline] path_openat+0x26c0/0x2ec0 fs/namei.c:3660 do_filp_open+0x277/0x4f0 fs/namei.c:3687 do_sys_openat2+0x13b/0x500 fs/open.c:1278 do_sys_open fs/open.c:1294 [inline] __do_sys_openat fs/open.c:1310 [inline] __se_sys_openat fs/open.c:1305 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1305 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 3655: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1727 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1753 slab_free mm/slub.c:3507 [inline] kfree+0xc6/0x210 mm/slub.c:4555 skb_free_head net/core/skbuff.c:655 [inline] skb_release_data+0x596/0x730 net/core/skbuff.c:677 skb_release_all net/core/skbuff.c:742 [inline] __kfree_skb+0x56/0x1d0 net/core/skbuff.c:756 kfree_skb include/linux/skbuff.h:1375 [inline] hci_dev_open_sync+0x107e/0x1340 net/bluetooth/hci_sync.c:4052 hci_dev_do_open net/bluetooth/hci_core.c:482 [inline] hci_power_on+0x180/0x650 net/bluetooth/hci_core.c:963 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff88804a15f400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88804a15f400, ffff88804a15f600) The buggy address belongs to the physical page: page:ffffea0001285700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4a15c head:ffffea0001285700 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888011c41c80 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3837, tgid 3822 (syz-executor.4), ts 157375449288, free_ts 126127884131 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4198 __alloc_pages+0x259/0x560 mm/page_alloc.c:5426 __alloc_pages_node include/linux/gfp.h:587 [inline] alloc_slab_page+0x2e/0xf0 mm/slub.c:1799 allocate_slab+0x5e/0x520 mm/slub.c:1942 new_slab mm/slub.c:2002 [inline] ___slab_alloc+0x41e/0xcd0 mm/slub.c:3002 __slab_alloc mm/slub.c:3089 [inline] slab_alloc_node mm/slub.c:3180 [inline] kmem_cache_alloc_node_trace+0x29a/0x360 mm/slub.c:3278 kmalloc_node include/linux/slab.h:618 [inline] kzalloc_node include/linux/slab.h:744 [inline] create_io_worker+0xef/0x630 fs/io-wq.c:814 io_wqe_create_worker fs/io-wq.c:308 [inline] io_wqe_enqueue+0x9f3/0xd10 fs/io-wq.c:949 io_queue_iowq+0x339/0x480 fs/io_uring.c:2083 io_queue_async+0x15e/0x1d0 fs/io_uring.c:8782 io_queue_sqe fs/io_uring.c:8810 [inline] io_submit_sqe fs/io_uring.c:9061 [inline] io_submit_sqes+0x6c15/0x9870 fs/io_uring.c:9172 __do_sys_io_uring_enter fs/io_uring.c:12104 [inline] __se_sys_io_uring_enter+0x342/0x2110 fs/io_uring.c:12030 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page_list+0x12c/0x890 mm/page_alloc.c:3475 release_pages+0x2a04/0x2cb0 mm/swap.c:980 tlb_batch_pages_flush mm/mmu_gather.c:58 [inline] tlb_flush_mmu_free mm/mmu_gather.c:255 [inline] tlb_flush_mmu+0x850/0xa70 mm/mmu_gather.c:262 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:353 exit_mmap+0x1dc/0x530 mm/mmap.c:3164 __mmput+0x111/0x3a0 kernel/fork.c:1187 exit_mm+0x211/0x2f0 kernel/exit.c:510 do_exit+0x4ca/0x1ed0 kernel/exit.c:782 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Memory state around the buggy address: ffff88804a15f300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804a15f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88804a15f400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804a15f480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804a15f500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================