================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:348 [inline] BUG: KASAN: slab-out-of-bounds in bacpy+0x23/0x30 include/net/bluetooth/bluetooth.h:236 Read of size 6 at addr ffff88804a1cfec6 by task kworker/u5:1/31030 CPU: 1 PID: 31030 Comm: kworker/u5:1 Not tainted 4.19.102-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: hci2 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x123/0x190 mm/kasan/kasan.c:267 memcpy+0x24/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:348 [inline] bacpy+0x23/0x30 include/net/bluetooth/bluetooth.h:236 hci_extended_inquiry_result_evt net/bluetooth/hci_event.c:4162 [inline] hci_event_packet+0x48fb/0xaa40 net/bluetooth/hci_event.c:5844 hci_rx_work+0x478/0xae0 net/bluetooth/hci_core.c:4359 process_one_work+0x989/0x1750 kernel/workqueue.c:2153 worker_thread+0x98/0xe40 kernel/workqueue.c:2296 kthread+0x354/0x420 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 10335: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node_track_caller+0x51/0x80 mm/slab.c:3703 __kmalloc_reserve.isra.0+0x40/0xf0 net/core/skbuff.c:137 __alloc_skb+0x10b/0x5f0 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:995 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:339 [inline] vhci_get_user drivers/bluetooth/hci_vhci.c:180 [inline] vhci_write+0xc4/0x470 drivers/bluetooth/hci_vhci.c:299 call_write_iter include/linux/fs.h:1820 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x587/0x810 fs/read_write.c:487 vfs_write+0x20c/0x560 fs/read_write.c:549 ksys_write+0x14f/0x2d0 fs/read_write.c:599 __do_sys_write fs/read_write.c:611 [inline] __se_sys_write fs/read_write.c:608 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:608 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 1258: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 skb_free_head+0x99/0xc0 net/core/skbuff.c:554 skb_release_data+0x619/0x8d0 net/core/skbuff.c:574 skb_release_all+0x4d/0x60 net/core/skbuff.c:631 __kfree_skb net/core/skbuff.c:645 [inline] kfree_skb net/core/skbuff.c:663 [inline] kfree_skb+0xe8/0x390 net/core/skbuff.c:657 vti6_tnl_xmit+0x5ac/0x1c90 net/ipv6/ip6_vti.c:571 __netdev_start_xmit include/linux/netdevice.h:4314 [inline] netdev_start_xmit include/linux/netdevice.h:4323 [inline] xmit_one net/core/dev.c:3258 [inline] dev_hard_start_xmit+0x1a5/0x970 net/core/dev.c:3274 __dev_queue_xmit+0x2704/0x2fe0 net/core/dev.c:3844 dev_queue_xmit+0x18/0x20 net/core/dev.c:3877 neigh_direct_output+0x16/0x20 net/core/neighbour.c:1414 neigh_output include/net/neighbour.h:501 [inline] ip6_finish_output2+0xb7f/0x2560 net/ipv6/ip6_output.c:120 ip6_finish_output+0x574/0xbe0 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip6_output+0x235/0x7c0 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:447 [inline] ip6_local_out+0xbb/0x184 net/ipv6/output_core.c:178 ip6_send_skb+0xbb/0x300 net/ipv6/ip6_output.c:1699 ip6_push_pending_frames+0xc8/0xf0 net/ipv6/ip6_output.c:1719 rawv6_push_pending_frames net/ipv6/raw.c:618 [inline] rawv6_sendmsg+0x29f8/0x3620 net/ipv6/raw.c:959 inet_sendmsg+0x141/0x5d0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:632 ___sys_sendmsg+0x3e2/0x920 net/socket.c:2115 __sys_sendmmsg+0x1bf/0x4e0 net/socket.c:2210 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2236 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88804a1cfcc0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 6 bytes to the right of 512-byte region [ffff88804a1cfcc0, ffff88804a1cfec0) The buggy address belongs to the page: page:ffffea00012873c0 count:1 mapcount:0 mapping:ffff88812c31c940 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea0001261f88 ffffea000109f388 ffff88812c31c940 raw: 0000000000000000 ffff88804a1cf040 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88804a1cfd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804a1cfe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88804a1cfe80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff88804a1cff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804a1cff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================