Bluetooth: hci2: unexpected cc 0x0c38 length: 249 > 2 ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline] BUG: KASAN: slab-use-after-free in skb_data_unref include/linux/skbuff.h:1246 [inline] BUG: KASAN: slab-use-after-free in skb_release_data+0x103/0x880 net/core/skbuff.c:1090 Read of size 4 at addr ffff888061553460 by task kworker/u9:1/23062 CPU: 0 PID: 23062 Comm: kworker/u9:1 Not tainted 6.10.0-rc4-syzkaller-00868-ge9212f9dd1fb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: hci2 hci_cmd_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:68 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline] skb_data_unref include/linux/skbuff.h:1246 [inline] skb_release_data+0x103/0x880 net/core/skbuff.c:1090 skb_release_all net/core/skbuff.c:1173 [inline] __kfree_skb net/core/skbuff.c:1187 [inline] sk_skb_reason_drop+0x1a5/0x3d0 net/core/skbuff.c:1225 kfree_skb_reason include/linux/skbuff.h:1260 [inline] kfree_skb include/linux/skbuff.h:1269 [inline] hci_send_cmd_sync net/bluetooth/hci_core.c:4105 [inline] hci_cmd_work+0xd1/0x670 net/bluetooth/hci_core.c:4143 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 23384: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4044 kmalloc_reserve+0xa8/0x2a0 net/core/skbuff.c:575 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:666 alloc_skb include/linux/skbuff.h:1320 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:489 [inline] hci_prepare_cmd+0x39/0x300 net/bluetooth/hci_request.c:221 hci_req_add_ev+0xac/0x290 net/bluetooth/hci_request.c:255 hci_scan_req+0xa0/0x180 net/bluetooth/hci_core.c:73 __hci_req_sync+0x1a8/0x950 net/bluetooth/hci_request.c:130 hci_req_sync+0xa9/0xd0 net/bluetooth/hci_request.c:206 hci_dev_cmd+0x4c5/0xa50 net/bluetooth/hci_core.c:787 sock_do_ioctl+0x158/0x460 net/socket.c:1222 sock_ioctl+0x629/0x8e0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 23384: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2196 [inline] slab_free mm/slub.c:4437 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4512 skb_kfree_head net/core/skbuff.c:1067 [inline] skb_free_head net/core/skbuff.c:1081 [inline] skb_release_data+0x64d/0x880 net/core/skbuff.c:1108 skb_release_all net/core/skbuff.c:1173 [inline] __kfree_skb net/core/skbuff.c:1187 [inline] sk_skb_reason_drop+0x1a5/0x3d0 net/core/skbuff.c:1225 kfree_skb_reason include/linux/skbuff.h:1260 [inline] kfree_skb include/linux/skbuff.h:1269 [inline] __hci_req_sync+0x631/0x950 net/bluetooth/hci_request.c:184 hci_req_sync+0xa9/0xd0 net/bluetooth/hci_request.c:206 hci_dev_cmd+0x4c5/0xa50 net/bluetooth/hci_core.c:787 sock_do_ioctl+0x158/0x460 net/socket.c:1222 sock_ioctl+0x629/0x8e0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888061553300 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 352 bytes inside of freed 640-byte region [ffff888061553300, ffff888061553580) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x61550 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff888018ac7a00 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000150015 00000001ffffefff 0000000000000000 head: 00fff00000000040 ffff888018ac7a00 0000000000000000 dead000000000001 head: 0000000000000000 0000000000150015 00000001ffffefff 0000000000000000 head: 00fff00000000002 ffffea0001855401 ffffffffffffffff 0000000000000000 head: ffff888000000004 0000000000000000 00000000ffffffff 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 0x1f2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_MEMALLOC|__GFP_HARDWALL), pid 16838, tgid 16838 (kworker/u8:12), ts 1519427159558, free_ts 1518415393525 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x2e43/0x2f00 mm/page_alloc.c:3420 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2265 allocate_slab+0x5a/0x2f0 mm/slub.c:2428 new_slab mm/slub.c:2481 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3667 __slab_alloc+0x58/0xa0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] kmem_cache_alloc_node_noprof+0x1fe/0x320 mm/slub.c:4044 kmalloc_reserve+0xa8/0x2a0 net/core/skbuff.c:575 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:666 __netdev_alloc_skb+0x105/0x560 net/core/skbuff.c:730 netdev_alloc_skb include/linux/skbuff.h:3345 [inline] dev_alloc_skb include/linux/skbuff.h:3358 [inline] __ieee80211_beacon_get+0x998/0x15c0 net/mac80211/tx.c:5471 ieee80211_beacon_get_tim+0xb4/0x320 net/mac80211/tx.c:5593 ieee80211_beacon_get include/net/mac80211.h:5601 [inline] mac80211_hwsim_beacon_tx+0x39d/0x850 drivers/net/wireless/virtual/mac80211_hwsim.c:2302 __iterate_interfaces+0x223/0x4c0 net/mac80211/util.c:772 ieee80211_iterate_active_interfaces_atomic+0xd8/0x170 net/mac80211/util.c:808 page last free pid 19716 tgid 19716 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2583 vfree+0x186/0x2e0 mm/vmalloc.c:3346 kcov_put kernel/kcov.c:429 [inline] kcov_close+0x2b/0x50 kernel/kcov.c:525 __fput+0x406/0x8b0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa27/0x27e0 kernel/exit.c:874 do_group_exit+0x207/0x2c0 kernel/exit.c:1023 get_signal+0x16a1/0x1740 kernel/signal.c:2909 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888061553300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888061553380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888061553400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888061553480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888061553500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================