================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:352 [inline] BUG: KASAN: slab-out-of-bounds in bacpy+0x23/0x30 include/net/bluetooth/bluetooth.h:236 Read of size 6 at addr ffff8880a4aad2c6 by task kworker/u5:3/3948 CPU: 1 PID: 3948 Comm: kworker/u5:3 Not tainted 5.0.0+ #10 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x123/0x190 mm/kasan/generic.c:191 memcpy+0x24/0x50 mm/kasan/common.c:132 memcpy include/linux/string.h:352 [inline] bacpy+0x23/0x30 include/net/bluetooth/bluetooth.h:236 hci_extended_inquiry_result_evt net/bluetooth/hci_event.c:4197 [inline] hci_event_packet+0x481b/0xa8e1 net/bluetooth/hci_event.c:5875 hci_rx_work+0x440/0xaa0 net/bluetooth/hci_core.c:4458 process_one_work+0x98e/0x1790 kernel/workqueue.c:2259 worker_thread+0x98/0xe40 kernel/workqueue.c:2405 kthread+0x357/0x430 kernel/kthread.c:253 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 9841: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:511 __do_kmalloc_node mm/slab.c:3686 [inline] __kmalloc_node_track_caller+0x4e/0x70 mm/slab.c:3700 __kmalloc_reserve.isra.0+0x40/0xf0 net/core/skbuff.c:140 __alloc_skb+0x10b/0x5e0 net/core/skbuff.c:208 alloc_skb include/linux/skbuff.h:1011 [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:1869 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x613/0x8e0 fs/read_write.c:487 vfs_write+0x20c/0x580 fs/read_write.c:549 ksys_write+0xea/0x1f0 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7305: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3821 snd_seq_release+0xbd/0xf0 sound/core/seq/seq_clientmgr.c:370 __fput+0x2df/0x8d0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x90a/0x2fa0 kernel/exit.c:875 do_group_exit+0x135/0x370 kernel/exit.c:979 get_signal+0x399/0x1d50 kernel/signal.c:2575 do_signal+0x87/0x1940 arch/x86/kernel/signal.c:816 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a4aad0c0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 6 bytes to the right of 512-byte region [ffff8880a4aad0c0, ffff8880a4aad2c0) The buggy address belongs to the page: page:ffffea000292ab40 count:1 mapcount:0 mapping:ffff88812c3f0940 index:0xffff8880a4aad840 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002a14d08 ffffea0002331d48 ffff88812c3f0940 raw: ffff8880a4aad840 ffff8880a4aad0c0 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a4aad180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a4aad200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880a4aad280: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff8880a4aad300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8880a4aad380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================