================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1481 Read of size 2 at addr ffff88807865c408 by task kworker/0:6/3667 CPU: 0 PID: 3667 Comm: kworker/0:6 Not tainted 5.19.0-rc2-next-20220615-syzkaller #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+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1481 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Allocated by task 10450: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:600 [inline] batadv_forw_packet_alloc+0x3ac/0x4d0 net/batman-adv/send.c:519 batadv_iv_ogm_aggregate_new+0x134/0x4e0 net/batman-adv/bat_iv_ogm.c:563 batadv_iv_ogm_queue_add net/batman-adv/bat_iv_ogm.c:671 [inline] batadv_iv_ogm_schedule_buff+0xe46/0x1430 net/batman-adv/bat_iv_ogm.c:850 batadv_iv_ogm_schedule net/batman-adv/bat_iv_ogm.c:869 [inline] batadv_iv_ogm_schedule net/batman-adv/bat_iv_ogm.c:862 [inline] batadv_iv_send_outstanding_bat_ogm_packet+0x740/0x910 net/batman-adv/bat_iv_ogm.c:1713 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Freed by task 13591: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3536 [inline] kfree+0xd6/0x4d0 mm/slub.c:4584 skb_free_head+0xac/0x110 net/core/skbuff.c:659 skb_release_data+0x67a/0x810 net/core/skbuff.c:681 skb_release_all net/core/skbuff.c:746 [inline] __kfree_skb net/core/skbuff.c:760 [inline] kfree_skb_reason.part.0+0xe2/0x320 net/core/skbuff.c:782 kfree_skb_reason+0x85/0x110 include/linux/refcount.h:279 kfree_skb include/linux/skbuff.h:1198 [inline] hci_dev_open_sync+0xb8c/0x2160 net/bluetooth/hci_sync.c:4052 hci_dev_do_open+0x32/0x70 net/bluetooth/hci_core.c:482 hci_power_on+0x133/0x630 net/bluetooth/hci_core.c:970 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x62f/0x1150 kernel/workqueue.c:1517 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x29b/0x9c2 kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x62f/0x1150 kernel/workqueue.c:1517 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x29b/0x9c2 kernel/softirq.c:571 The buggy address belongs to the object at ffff88807865c400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88807865c400, ffff88807865c600) The buggy address belongs to the physical page: page:ffffea0001e19700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7865c head:ffffea0001e19700 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888011841c80 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3614, tgid 3614 (syz-executor.0), ts 54934249594, free_ts 54905521404 prep_new_page mm/page_alloc.c:2525 [inline] get_page_from_freelist+0x1efe/0x3a20 mm/page_alloc.c:4296 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5512 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x9c4/0xe20 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmalloc+0x318/0x350 mm/slub.c:4442 kmalloc include/linux/slab.h:605 [inline] kzalloc include/linux/slab.h:733 [inline] tomoyo_init_log+0x128a/0x1ed0 security/tomoyo/audit.c:275 tomoyo_supervisor+0x34d/0xf00 security/tomoyo/common.c:2088 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x419/0x590 security/tomoyo/file.c:734 security_file_ioctl+0x50/0xb0 security/security.c:1551 __do_sys_ioctl fs/ioctl.c:864 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0xb3/0x200 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 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:1443 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1493 free_unref_page_prepare mm/page_alloc.c:3373 [inline] free_unref_page+0x19/0x560 mm/page_alloc.c:3470 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+0xa2/0xc0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] kmem_cache_alloc_trace+0x26d/0x3f0 mm/slub.c:3282 kmalloc include/linux/slab.h:600 [inline] __netdev_adjacent_dev_insert+0x1d8/0xaa0 net/core/dev.c:7475 __netdev_adjacent_dev_link_lists net/core/dev.c:7567 [inline] __netdev_adjacent_dev_link_neighbour net/core/dev.c:7596 [inline] __netdev_upper_dev_link+0x39c/0x7f0 net/core/dev.c:7656 netdev_master_upper_dev_link+0x98/0xd0 net/core/dev.c:7731 bond_master_upper_dev_link drivers/net/bonding/bond_main.c:1621 [inline] bond_enslave+0x2894/0x53b0 drivers/net/bonding/bond_main.c:2105 do_set_master+0x1c8/0x220 net/core/rtnetlink.c:2577 do_setlink+0x9e7/0x3bb0 net/core/rtnetlink.c:2787 __rtnl_newlink+0xd6a/0x17e0 net/core/rtnetlink.c:3546 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3593 rtnetlink_rcv_msg+0x43a/0xc90 net/core/rtnetlink.c:6089 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 Memory state around the buggy address: ffff88807865c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807865c380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807865c400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807865c480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807865c500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================