================================================================== BUG: KASAN: slab-use-after-free in hci_cmd_timeout+0x216/0x260 net/bluetooth/hci_core.c:1522 Read of size 2 at addr ffff88803ecdecb8 by task kworker/u33:3/5227 CPU: 2 PID: 5227 Comm: kworker/u33:3 Not tainted 6.9.0-syzkaller-11952-gc760b3725e52 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Workqueue: hci0 hci_cmd_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 hci_cmd_timeout+0x216/0x260 net/bluetooth/hci_core.c:1522 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 5227: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4007 skb_clone+0x190/0x3f0 net/core/skbuff.c:2052 hci_send_cmd_sync net/bluetooth/hci_core.c:4123 [inline] hci_cmd_work+0x66a/0x710 net/bluetooth/hci_core.c:4143 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 9373: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2195 [inline] slab_free mm/slub.c:4436 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4511 kfree_skbmem+0x10e/0x200 net/core/skbuff.c:1131 __kfree_skb net/core/skbuff.c:1188 [inline] kfree_skb_reason+0x138/0x210 net/core/skbuff.c:1223 kfree_skb include/linux/skbuff.h:1257 [inline] __hci_req_sync+0x61d/0x980 net/bluetooth/hci_request.c:184 hci_req_sync+0x97/0xd0 net/bluetooth/hci_request.c:206 hci_inquiry+0x3ea/0x950 net/bluetooth/hci_core.c:427 hci_sock_ioctl+0x2bb/0x880 net/bluetooth/hci_sock.c:1153 sock_do_ioctl+0x116/0x280 net/socket.c:1222 sock_ioctl+0x22e/0x6c0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803ecdec80 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 56 bytes inside of freed 240-byte region [ffff88803ecdec80, ffff88803ecded70) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3ecde head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff88801631e000 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000190019 00000001ffffefff 0000000000000000 head: 00fff00000000040 ffff88801631e000 dead000000000100 dead000000000122 head: 0000000000000000 0000000000190019 00000001ffffefff 0000000000000000 head: 00fff00000000001 ffffea0000fb3781 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5191, tgid 5191 (sshd), ts 117735168829, free_ts 116710736925 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2df0 mm/page_alloc.c:3402 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4660 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2264 allocate_slab mm/slub.c:2427 [inline] new_slab+0x84/0x260 mm/slub.c:2480 ___slab_alloc+0xdac/0x1870 mm/slub.c:3666 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3756 __slab_alloc_node mm/slub.c:3809 [inline] slab_alloc_node mm/slub.c:3988 [inline] kmem_cache_alloc_noprof+0x2ae/0x2f0 mm/slub.c:4007 skb_clone+0x190/0x3f0 net/core/skbuff.c:2052 dev_queue_xmit_nit+0x38f/0xba0 net/core/dev.c:2311 xmit_one net/core/dev.c:3574 [inline] dev_hard_start_xmit+0x56/0x790 net/core/dev.c:3594 sch_direct_xmit+0x1ac/0xc20 net/sched/sch_generic.c:343 __dev_xmit_skb net/core/dev.c:3807 [inline] __dev_queue_xmit+0x12ad/0x4130 net/core/dev.c:4359 dev_queue_xmit include/linux/netdevice.h:3095 [inline] neigh_hh_output include/net/neighbour.h:526 [inline] neigh_output include/net/neighbour.h:540 [inline] ip_finish_output2+0x16fc/0x25e0 net/ipv4/ip_output.c:235 __ip_finish_output net/ipv4/ip_output.c:313 [inline] __ip_finish_output+0x49e/0x950 net/ipv4/ip_output.c:295 ip_finish_output+0x31/0x310 net/ipv4/ip_output.c:323 page last free pid 5191 tgid 5191 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2565 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4043 __alloc_skb+0x2b1/0x380 net/core/skbuff.c:656 alloc_skb_fclone include/linux/skbuff.h:1358 [inline] tcp_stream_alloc_skb+0x34/0x570 net/ipv4/tcp.c:879 tcp_sendmsg_locked+0xecc/0x34c0 net/ipv4/tcp.c:1161 tcp_sendmsg+0x2e/0x50 net/ipv4/tcp.c:1348 inet_sendmsg+0xb9/0x140 net/ipv4/af_inet.c:851 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x4b8/0x5c0 net/socket.c:1160 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x1f8/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88803ecdeb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803ecdec00: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc >ffff88803ecdec80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803ecded00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff88803ecded80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================