================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x239/0x250 net/bluetooth/hci_core.c:1494 Read of size 8 at addr ffff88801d43c998 by task kworker/u5:2/3651 CPU: 1 PID: 3651 Comm: kworker/u5:2 Not tainted 6.0.0-rc6-next-20220923-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Workqueue: hci7 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:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 hci_cmd_timeout+0x239/0x250 net/bluetooth/hci_core.c:1494 process_one_work+0x9bf/0x1710 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 3656: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7e/0x80 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:754 [inline] slab_alloc_node mm/slub.c:3336 [inline] slab_alloc mm/slub.c:3344 [inline] __kmem_cache_alloc_lru mm/slub.c:3351 [inline] kmem_cache_alloc+0x2b7/0x3d0 mm/slub.c:3360 skb_clone+0x16e/0x3c0 net/core/skbuff.c:1548 hci_cmd_work+0x191/0x570 net/bluetooth/hci_core.c:4064 process_one_work+0x9bf/0x1710 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 3662: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2a/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1669 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1695 slab_free mm/slub.c:3599 [inline] kmem_cache_free+0xea/0x5b0 mm/slub.c:3621 kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:714 __kfree_skb net/core/skbuff.c:771 [inline] kfree_skb_reason+0x193/0x4b0 net/core/skbuff.c:793 kfree_skb include/linux/skbuff.h:1207 [inline] hci_dev_open_sync+0xbe2/0x2190 net/bluetooth/hci_sync.c:4698 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+0x9bf/0x1710 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 The buggy address belongs to the object at ffff88801d43c8c0 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 216 bytes inside of 240-byte region [ffff88801d43c8c0, ffff88801d43c9b0) The buggy address belongs to the physical page: page:ffffea0000750f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xdead000000000100 pfn:0x1d43c memcg:ffff88807ca7f481 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888012734500 dead0000000c000c 0000000000000000 raw: dead000000000100 dead000000000122 00000001ffffffff ffff88807ca7f481 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 3607, tgid 3600 (syz-fuzzer), ts 73274010740, free_ts 73239819320 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x1092/0x2d20 mm/page_alloc.c:4287 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5546 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1739 [inline] allocate_slab+0x213/0x300 mm/slub.c:1884 new_slab mm/slub.c:1937 [inline] ___slab_alloc+0xac1/0x1430 mm/slub.c:3119 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3217 slab_alloc_node mm/slub.c:3302 [inline] kmem_cache_alloc_node+0x18b/0x400 mm/slub.c:3381 __alloc_skb+0x210/0x2f0 net/core/skbuff.c:422 alloc_skb include/linux/skbuff.h:1258 [inline] __tcp_send_ack.part.0+0x67/0x760 net/ipv4/tcp_output.c:3955 __tcp_send_ack net/ipv4/tcp_output.c:3987 [inline] tcp_send_ack+0x7d/0xa0 net/ipv4/tcp_output.c:3987 __tcp_cleanup_rbuf+0x356/0x470 net/ipv4/tcp.c:1617 tcp_recvmsg_locked+0x72c/0x22c0 net/ipv4/tcp.c:2649 tcp_recvmsg+0x113/0x620 net/ipv4/tcp.c:2679 inet_recvmsg+0x110/0x5d0 net/ipv4/af_inet.c:850 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_recvmsg net/socket.c:1009 [inline] sock_read_iter+0x344/0x470 net/socket.c:1086 call_read_iter include/linux/fs.h:2184 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x7f6/0x930 fs/read_write.c:470 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1458 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3482 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2532 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x62/0x80 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:754 [inline] slab_alloc_node mm/slub.c:3336 [inline] kmem_cache_alloc_node+0x2ff/0x400 mm/slub.c:3381 __alloc_skb+0x210/0x2f0 net/core/skbuff.c:422 alloc_skb_fclone include/linux/skbuff.h:1308 [inline] tcp_stream_alloc_skb+0x38/0x580 net/ipv4/tcp.c:861 tcp_sendmsg_locked+0xc36/0x2f90 net/ipv4/tcp.c:1325 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1483 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 sock_write_iter+0x291/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2190 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:578 ksys_write+0x1e8/0x250 fs/read_write.c:631 Memory state around the buggy address: ffff88801d43c880: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88801d43c900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801d43c980: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ^ ffff88801d43ca00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801d43ca80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ==================================================================