================================================================== BUG: KASAN: slab-use-after-free in lockdep_register_key+0x253/0x3f0 kernel/locking/lockdep.c:1225 Read of size 8 at addr ffff88805ea0f298 by task syz-executor.4/10679 CPU: 1 PID: 10679 Comm: syz-executor.4 Not tainted 6.9.0-rc6-next-20240501-syzkaller #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:489 map_create+0x90c/0x1200 kernel/bpf/syscall.c:1333 __sys_bpf+0x6d1/0x810 kernel/bpf/syscall.c:5669 __do_sys_bpf kernel/bpf/syscall.c:5794 [inline] __se_sys_bpf kernel/bpf/syscall.c:5792 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5792 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:0x7f2a20e7dea9 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:00007f2a21b1b0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f2a20fabf80 RCX: 00007f2a20e7dea9 RDX: 0000000000000048 RSI: 0000000020000100 RDI: 0000000000000000 RBP: 00007f2a20eca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f2a20fabf80 R15: 00007ffc4880bea8 Allocated by task 2894: 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:4115 [inline] kmalloc_node_track_caller_noprof+0x22a/0x440 mm/slub.c:4135 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:600 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:669 alloc_skb include/linux/skbuff.h:1319 [inline] nlmsg_new include/net/netlink.h:1015 [inline] inet6_rt_notify+0xdf/0x290 net/ipv6/route.c:6175 fib6_del_route net/ipv6/ip6_fib.c:2008 [inline] fib6_del+0x10c5/0x1600 net/ipv6/ip6_fib.c:2043 fib6_clean_node+0x2f7/0x5e0 net/ipv6/ip6_fib.c:2205 fib6_walk_continue+0x658/0x8f0 net/ipv6/ip6_fib.c:2127 fib6_walk+0x168/0x2b0 net/ipv6/ip6_fib.c:2175 fib6_clean_tree net/ipv6/ip6_fib.c:2255 [inline] __fib6_clean_all+0x31f/0x4b0 net/ipv6/ip6_fib.c:2271 rt6_sync_down_dev net/ipv6/route.c:4903 [inline] rt6_disable_ip+0x170/0x890 net/ipv6/route.c:4908 addrconf_ifdown+0x15d/0x1bc0 net/ipv6/addrconf.c:3855 addrconf_notify+0x3cb/0x1020 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:2016 [inline] call_netdevice_notifiers net/core/dev.c:2030 [inline] dev_close_many+0x33c/0x4c0 net/core/dev.c:1571 unregister_netdevice_many_notify+0x544/0x16e0 net/core/dev.c:11181 unregister_netdevice_many net/core/dev.c:11264 [inline] default_device_exit_batch+0xa0f/0xa90 net/core/dev.c:11743 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x89d/0xcc0 net/core/net_namespace.c:637 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 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 2894: 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+0xe0/0x150 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:2190 [inline] slab_free mm/slub.c:4430 [inline] kfree+0x149/0x350 mm/slub.c:4551 skb_kfree_head net/core/skbuff.c:1036 [inline] skb_free_head net/core/skbuff.c:1048 [inline] skb_release_data+0x676/0x880 net/core/skbuff.c:1075 skb_release_all net/core/skbuff.c:1140 [inline] __kfree_skb net/core/skbuff.c:1154 [inline] consume_skb+0xb1/0x160 net/core/skbuff.c:1376 netlink_broadcast_filtered+0x1168/0x1290 net/netlink/af_netlink.c:1546 nlmsg_multicast_filtered include/net/netlink.h:1125 [inline] nlmsg_multicast include/net/netlink.h:1144 [inline] nlmsg_notify+0xfb/0x1c0 net/netlink/af_netlink.c:2607 fib6_del_route net/ipv6/ip6_fib.c:2008 [inline] fib6_del+0x10c5/0x1600 net/ipv6/ip6_fib.c:2043 fib6_clean_node+0x2f7/0x5e0 net/ipv6/ip6_fib.c:2205 fib6_walk_continue+0x658/0x8f0 net/ipv6/ip6_fib.c:2127 fib6_walk+0x168/0x2b0 net/ipv6/ip6_fib.c:2175 fib6_clean_tree net/ipv6/ip6_fib.c:2255 [inline] __fib6_clean_all+0x31f/0x4b0 net/ipv6/ip6_fib.c:2271 rt6_sync_down_dev net/ipv6/route.c:4903 [inline] rt6_disable_ip+0x170/0x890 net/ipv6/route.c:4908 addrconf_ifdown+0x15d/0x1bc0 net/ipv6/addrconf.c:3855 addrconf_notify+0x3cb/0x1020 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:2016 [inline] call_netdevice_notifiers net/core/dev.c:2030 [inline] dev_close_many+0x33c/0x4c0 net/core/dev.c:1571 unregister_netdevice_many_notify+0x544/0x16e0 net/core/dev.c:11181 unregister_netdevice_many net/core/dev.c:11264 [inline] default_device_exit_batch+0xa0f/0xa90 net/core/dev.c:11743 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x89d/0xcc0 net/core/net_namespace.c:637 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 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 ffff88805ea0f000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 664 bytes inside of freed 1024-byte region [ffff88805ea0f000, ffff88805ea0f400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805ea08800 pfn:0x5ea08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000240 ffff888015041dc0 ffffea0000b75610 ffffea0001e35410 raw: ffff88805ea08800 000000000010000a 00000001ffffefff 0000000000000000 head: 00fff00000000240 ffff888015041dc0 ffffea0000b75610 ffffea0001e35410 head: ffff88805ea08800 000000000010000a 00000001ffffefff 0000000000000000 head: 00fff00000000003 ffffea00017a8201 ffffffffffffffff 0000000000000000 head: 0000000000000008 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5122, tgid 5122 (syz-executor.3), ts 61750132597, free_ts 13964957501 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3438 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4696 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2259 allocate_slab+0x5a/0x2e0 mm/slub.c:2422 new_slab mm/slub.c:2475 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3661 __slab_alloc+0x58/0xa0 mm/slub.c:3751 __slab_alloc_node mm/slub.c:3804 [inline] slab_alloc_node mm/slub.c:3982 [inline] kmalloc_trace_noprof+0x1d5/0x2b0 mm/slub.c:4141 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] batadv_hardif_add_interface net/batman-adv/hard-interface.c:882 [inline] batadv_hard_if_event+0xe71/0x1620 net/batman-adv/hard-interface.c:970 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:2016 [inline] call_netdevice_notifiers net/core/dev.c:2030 [inline] register_netdevice+0x159d/0x1a10 net/core/dev.c:10387 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:505 [inline] nsim_create+0x41d/0x500 drivers/net/netdevsim/netdev.c:563 __nsim_dev_port_add+0x6c0/0xae0 drivers/net/netdevsim/dev.c:1390 nsim_dev_port_add_all+0x33/0xf0 drivers/net/netdevsim/dev.c:1446 nsim_drv_probe+0x85f/0xb80 drivers/net/netdevsim/dev.c:1604 really_probe+0x2b8/0xad0 drivers/base/dd.c:656 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2601 free_contig_range+0x9e/0x160 mm/page_alloc.c:6655 destroy_args+0x8a/0x890 mm/debug_vm_pgtable.c:1037 debug_vm_pgtable+0x4be/0x550 mm/debug_vm_pgtable.c:1417 do_one_initcall+0x248/0x880 init/main.c:1265 do_initcall_level+0x157/0x210 init/main.c:1327 do_initcalls+0x3f/0x80 init/main.c:1343 kernel_init_freeable+0x435/0x5d0 init/main.c:1576 kernel_init+0x1d/0x2b0 init/main.c:1465 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88805ea0f180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805ea0f200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805ea0f280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805ea0f300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805ea0f380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================