================================================================== BUG: KASAN: slab-out-of-bounds in lockdep_register_key+0x253/0x3f0 kernel/locking/lockdep.c:1225 Read of size 8 at addr ffff88802e6c7298 by task syz-executor.2/9566 CPU: 1 PID: 9566 Comm: syz-executor.2 Not tainted 6.9.0-rc5-syzkaller-01459-gc2e6a872bde9 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 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 lockdep_register_key+0x253/0x3f0 kernel/locking/lockdep.c:1225 htab_map_alloc+0x9b/0xe60 kernel/bpf/hashtab.c:506 map_create+0x90c/0x1200 kernel/bpf/syscall.c:1333 __sys_bpf+0x6d1/0x810 kernel/bpf/syscall.c:5659 __do_sys_bpf kernel/bpf/syscall.c:5784 [inline] __se_sys_bpf kernel/bpf/syscall.c:5782 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5782 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f156e67dea9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f156f3a50c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f156e7ac050 RCX: 00007f156e67dea9 RDX: 0000000000000048 RSI: 00000000200004c0 RDI: 0000000000000000 RBP: 00007f156e6ca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f156e7ac050 R15: 00007ffc347589a8 Allocated by task 927: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3966 [inline] __kmalloc_node_track_caller+0x24e/0x4e0 mm/slub.c:3986 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:597 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:666 alloc_skb include/linux/skbuff.h:1308 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline] nsim_dev_trap_report_work+0x254/0xaa0 drivers/net/netdevsim/dev.c:850 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 927: 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+0xa6/0xe0 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:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0x153/0x3a0 mm/slub.c:4390 skb_kfree_head net/core/skbuff.c:1033 [inline] skb_free_head net/core/skbuff.c:1045 [inline] skb_release_data+0x676/0x880 net/core/skbuff.c:1072 skb_release_all net/core/skbuff.c:1137 [inline] __kfree_skb net/core/skbuff.c:1151 [inline] consume_skb+0xb1/0x160 net/core/skbuff.c:1373 nsim_dev_trap_report drivers/net/netdevsim/dev.c:821 [inline] nsim_dev_trap_report_work+0x765/0xaa0 drivers/net/netdevsim/dev.c:850 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88802e6c6000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 664 bytes to the right of allocated 4096-byte region [ffff88802e6c6000, ffff88802e6c7000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2e6c0 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000840 ffff888015042140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 head: 00fff80000000840 ffff888015042140 dead000000000122 0000000000000000 head: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 head: 00fff80000000003 ffffea0000b9b001 ffffea0000b9b048 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 927, tgid -173826839 (kworker/0:3), ts 927, free_ts 193087931751 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x3410/0x35b0 mm/page_alloc.c:3317 __alloc_pages+0x256/0x6c0 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2175 allocate_slab mm/slub.c:2338 [inline] new_slab+0x84/0x2f0 mm/slub.c:2391 ___slab_alloc+0xc73/0x1260 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc_node_track_caller+0x2d6/0x4e0 mm/slub.c:3986 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:597 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:666 alloc_skb include/linux/skbuff.h:1308 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline] nsim_dev_trap_report_work+0x254/0xaa0 drivers/net/netdevsim/dev.c:850 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page last free pid 15 tgid 15 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x986/0xab0 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 __folio_put_large+0x13f/0x190 mm/swap.c:132 __folio_put+0x299/0x390 mm/swap.c:140 page_to_skb+0x3d7/0x9b0 drivers/net/virtio_net.c:813 receive_mergeable drivers/net/virtio_net.c:1841 [inline] receive_buf+0x3b3/0x3890 drivers/net/virtio_net.c:1962 virtnet_receive drivers/net/virtio_net.c:2268 [inline] virtnet_poll+0x83e/0x1aa0 drivers/net/virtio_net.c:2365 __napi_poll+0xcb/0x490 net/core/dev.c:6707 napi_poll net/core/dev.c:6776 [inline] net_rx_action+0x7bb/0x10a0 net/core/dev.c:6892 __do_softirq+0x2c6/0x980 kernel/softirq.c:554 Memory state around the buggy address: ffff88802e6c7180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802e6c7200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802e6c7280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802e6c7300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802e6c7380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================