================================================================== BUG: KASAN: slab-out-of-bounds in skb_put_data include/linux/skbuff.h:2752 [inline] BUG: KASAN: slab-out-of-bounds in hci_cmd_sync_alloc+0x300/0x3a0 net/bluetooth/hci_sync.c:67 Read of size 29542 at addr ffff88802826a706 by task kworker/u33:0/67 CPU: 3 UID: 0 PID: 67 Comm: kworker/u33:0 Not tainted 6.15.0-rc6-syzkaller-g9f35e33144ae #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: hci0 hci_cmd_sync_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xe0/0x110 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 __asan_memcpy+0x23/0x60 mm/kasan/shadow.c:105 skb_put_data include/linux/skbuff.h:2752 [inline] hci_cmd_sync_alloc+0x300/0x3a0 net/bluetooth/hci_sync.c:67 hci_cmd_sync_add net/bluetooth/hci_sync.c:99 [inline] __hci_cmd_sync_sk+0x157/0xc90 net/bluetooth/hci_sync.c:168 __hci_cmd_sync_ev+0x3e/0x50 net/bluetooth/hci_sync.c:250 send_hci_cmd_sync+0x18d/0x3f0 net/bluetooth/mgmt.c:2540 hci_cmd_sync_work+0x1a8/0x430 net/bluetooth/hci_sync.c:332 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400 kthread+0x3c2/0x780 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 6491: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4327 [inline] __kmalloc_node_track_caller_noprof+0x221/0x510 mm/slub.c:4346 kmemdup_noprof+0x29/0x60 mm/util.c:137 kmemdup_noprof include/linux/fortify-string.h:765 [inline] mgmt_pending_new+0x10b/0x290 net/bluetooth/mgmt_util.c:259 mgmt_hci_cmd_sync net/bluetooth/mgmt.c:2574 [inline] mgmt_hci_cmd_sync+0x58/0x1c0 net/bluetooth/mgmt.c:2562 hci_mgmt_cmd net/bluetooth/hci_sock.c:1712 [inline] hci_sock_sendmsg+0x151f/0x25e0 net/bluetooth/hci_sock.c:1832 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg net/socket.c:727 [inline] sock_write_iter+0x4fc/0x5b0 net/socket.c:1131 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x5ba/0x1180 fs/read_write.c:684 ksys_write+0x205/0x240 fs/read_write.c:736 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802826a700 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 6 bytes inside of allocated 7-byte region [ffff88802826a700, ffff88802826a707) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802826ac20 pfn:0x2826a flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b442500 ffffea0000a81200 dead000000000002 raw: ffff88802826ac20 0000000080800060 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5948, tgid 5948 (syz-executor), ts 57027182518, free_ts 57004648307 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x135c/0x3920 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x263/0x23a0 mm/page_alloc.c:4970 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab mm/slub.c:2618 [inline] new_slab+0x244/0x340 mm/slub.c:2672 ___slab_alloc+0xd9c/0x1940 mm/slub.c:3858 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3948 __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] __do_kmalloc_node mm/slub.c:4326 [inline] __kmalloc_node_track_caller_noprof+0x2ee/0x510 mm/slub.c:4346 __kmemdup_nul mm/util.c:63 [inline] kstrdup+0x53/0x100 mm/util.c:83 kstrdup_const+0x63/0x80 mm/util.c:103 __kernfs_new_node+0x9b/0x8a0 fs/kernfs/dir.c:633 kernfs_new_node+0x13c/0x1e0 fs/kernfs/dir.c:713 kernfs_create_dir_ns+0x4c/0x1a0 fs/kernfs/dir.c:1081 sysfs_create_dir_ns+0x13a/0x2b0 fs/sysfs/dir.c:59 create_dir lib/kobject.c:73 [inline] kobject_add_internal+0x2c4/0x9b0 lib/kobject.c:240 kobject_add_varg lib/kobject.c:374 [inline] kobject_init_and_add+0x11b/0x190 lib/kobject.c:457 page last free pid 5948 tgid 5948 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0x69d/0xff0 mm/page_alloc.c:2725 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] __kmalloc_cache_noprof+0x1f1/0x3e0 mm/slub.c:4353 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] ref_tracker_alloc+0x18e/0x5b0 lib/ref_tracker.c:203 __netdev_tracker_alloc include/linux/netdevice.h:4331 [inline] netdev_hold include/linux/netdevice.h:4360 [inline] netdev_hold include/linux/netdevice.h:4355 [inline] rx_queue_add_kobject net/core/net-sysfs.c:1236 [inline] net_rx_queue_update_kobjects+0x32e/0x770 net/core/net-sysfs.c:1301 register_queue_kobjects net/core/net-sysfs.c:2093 [inline] netdev_register_kobject+0x269/0x3a0 net/core/net-sysfs.c:2340 register_netdevice+0x13dc/0x2270 net/core/dev.c:10997 veth_newlink+0x30f/0xa00 drivers/net/veth.c:1818 rtnl_newlink_create net/core/rtnetlink.c:3833 [inline] __rtnl_newlink net/core/rtnetlink.c:3950 [inline] rtnl_newlink+0xc45/0x2000 net/core/rtnetlink.c:4065 rtnetlink_rcv_msg+0x95b/0xe90 net/core/rtnetlink.c:6955 netlink_rcv_skb+0x16a/0x440 net/netlink/af_netlink.c:2534 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline] netlink_unicast+0x53d/0x7f0 net/netlink/af_netlink.c:1339 netlink_sendmsg+0x8d1/0xdd0 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg net/socket.c:727 [inline] __sys_sendto+0x495/0x510 net/socket.c:2180 Memory state around the buggy address: ffff88802826a600: fa fc fc fc 05 fc fc fc fa fc fc fc fa fc fc fc ffff88802826a680: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc >ffff88802826a700: 07 fc fc fc 05 fc fc fc fa fc fc fc fa fc fc fc ^ ffff88802826a780: fa fc fc fc fa fc fc fc 07 fc fc fc fa fc fc fc ffff88802826a800: 05 fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc ==================================================================