INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. CPU: 0 PID: 10584 Comm: kbnepd bnep0 Not tainted 6.9.0-rc5-syzkaller-00053-ge33c4963bf53 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 assign_lock_key kernel/locking/lockdep.c:976 [inline] register_lock_class+0xc2a/0x1230 kernel/locking/lockdep.c:1289 __lock_acquire+0x111/0x3b30 kernel/locking/lockdep.c:5014 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x36/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:376 [inline] pm_runtime_set_memalloc_noio+0x50/0x180 drivers/base/power/runtime.c:228 netdev_unregister_kobject+0x1ed/0x270 net/core/net-sysfs.c:2106 unregister_netdevice_many_notify+0xc8a/0x19f0 net/core/dev.c:11135 unregister_netdevice_many net/core/dev.c:11163 [inline] unregister_netdevice_queue+0x307/0x3f0 net/core/dev.c:11042 unregister_netdevice include/linux/netdevice.h:3115 [inline] unregister_netdev+0x1c/0x30 net/core/dev.c:11181 bnep_session+0x1fc4/0x2aa0 net/bluetooth/bnep/core.c:525 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 ================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff888055cd970c by task kbnepd bnep0/10584 CPU: 0 PID: 10584 Comm: kbnepd bnep0 Not tainted 6.9.0-rc5-syzkaller-00053-ge33c4963bf53 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115 spin_lock_irq include/linux/spinlock.h:376 [inline] pm_runtime_set_memalloc_noio+0x50/0x180 drivers/base/power/runtime.c:228 netdev_unregister_kobject+0x1ed/0x270 net/core/net-sysfs.c:2106 unregister_netdevice_many_notify+0xc8a/0x19f0 net/core/dev.c:11135 unregister_netdevice_many net/core/dev.c:11163 [inline] unregister_netdevice_queue+0x307/0x3f0 net/core/dev.c:11042 unregister_netdevice include/linux/netdevice.h:3115 [inline] unregister_netdev+0x1c/0x30 net/core/dev.c:11181 bnep_session+0x1fc4/0x2aa0 net/bluetooth/bnep/core.c:525 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 10584: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc_node+0x177/0x340 mm/slub.c:3888 kmalloc_reserve+0x18b/0x2c0 net/core/skbuff.c:577 __alloc_skb+0x164/0x380 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1313 [inline] alloc_uevent_skb+0x7d/0x210 lib/kobject_uevent.c:289 uevent_net_broadcast_tagged lib/kobject_uevent.c:352 [inline] kobject_uevent_net_broadcast lib/kobject_uevent.c:413 [inline] kobject_uevent_env+0x1126/0x15f0 lib/kobject_uevent.c:593 __kobject_del+0x168/0x1f0 lib/kobject.c:601 kobject_cleanup lib/kobject.c:680 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x31c/0x5b0 lib/kobject.c:737 netdev_queue_update_kobjects+0x4a2/0x640 net/core/net-sysfs.c:1854 remove_queue_kobjects net/core/net-sysfs.c:1951 [inline] netdev_unregister_kobject+0x15d/0x270 net/core/net-sysfs.c:2104 unregister_netdevice_many_notify+0xc8a/0x19f0 net/core/dev.c:11135 unregister_netdevice_many net/core/dev.c:11163 [inline] unregister_netdevice_queue+0x307/0x3f0 net/core/dev.c:11042 unregister_netdevice include/linux/netdevice.h:3115 [inline] unregister_netdev+0x1c/0x30 net/core/dev.c:11181 bnep_session+0x1fc4/0x2aa0 net/bluetooth/bnep/core.c:525 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 4694: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 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] kmem_cache_free+0x12e/0x380 mm/slub.c:4344 skb_kfree_head net/core/skbuff.c:1094 [inline] skb_kfree_head net/core/skbuff.c:1091 [inline] skb_free_head+0x19a/0x1e0 net/core/skbuff.c:1108 skb_release_data+0x76c/0x990 net/core/skbuff.c:1136 skb_release_all net/core/skbuff.c:1202 [inline] __kfree_skb net/core/skbuff.c:1216 [inline] consume_skb net/core/skbuff.c:1432 [inline] consume_skb+0xd2/0x170 net/core/skbuff.c:1426 netlink_recvmsg+0x606/0xf30 net/netlink/af_netlink.c:1983 sock_recvmsg_nosec net/socket.c:1046 [inline] sock_recvmsg+0x1f6/0x250 net/socket.c:1068 ____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803 ___sys_recvmsg+0x115/0x1a0 net/socket.c:2845 __sys_recvmsg+0x114/0x1e0 net/socket.c:2875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888055cd9500 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 524 bytes inside of freed 640-byte region [ffff888055cd9500, ffff888055cd9780) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x55cd8 head: order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff80000000840(slab|head|node=1|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 04fff80000000840 ffff888015f9a280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080150015 00000001ffffffff 0000000000000000 head: 04fff80000000840 ffff888015f9a280 dead000000000122 0000000000000000 head: 0000000000000000 0000000080150015 00000001ffffffff 0000000000000000 head: 04fff80000000002 ffffea0001573601 dead000000000122 00000000ffffffff head: 0000000400000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 10584, tgid 1036184367 (kbnepd bnep0), ts 10584, free_ts 151358991696 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x670/0x16d0 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmem_cache_alloc_node+0x10a/0x340 mm/slub.c:3888 kmalloc_reserve+0x18b/0x2c0 net/core/skbuff.c:577 __alloc_skb+0x164/0x380 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1313 [inline] alloc_uevent_skb+0x7d/0x210 lib/kobject_uevent.c:289 uevent_net_broadcast_tagged lib/kobject_uevent.c:352 [inline] kobject_uevent_net_broadcast lib/kobject_uevent.c:413 [inline] kobject_uevent_env+0x1126/0x15f0 lib/kobject_uevent.c:593 __kobject_del+0x168/0x1f0 lib/kobject.c:601 kobject_cleanup lib/kobject.c:680 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x31c/0x5b0 lib/kobject.c:737 netdev_queue_update_kobjects+0x4a2/0x640 net/core/net-sysfs.c:1854 remove_queue_kobjects net/core/net-sysfs.c:1951 [inline] netdev_unregister_kobject+0x15d/0x270 net/core/net-sysfs.c:2104 unregister_netdevice_many_notify+0xc8a/0x19f0 net/core/dev.c:11135 page last free pid 10584 tgid 10584 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+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 stack_depot_save_flags+0x2da/0x900 lib/stackdepot.c:673 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599 __alloc_skb+0x164/0x380 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1313 [inline] nlmsg_new include/net/netlink.h:1010 [inline] rtmsg_ifinfo_build_skb+0x82/0x280 net/core/rtnetlink.c:4048 unregister_netdevice_many_notify+0x953/0x19f0 net/core/dev.c:11109 unregister_netdevice_many net/core/dev.c:11163 [inline] unregister_netdevice_queue+0x307/0x3f0 net/core/dev.c:11042 unregister_netdevice include/linux/netdevice.h:3115 [inline] lapbeth_free_device drivers/net/wan/lapbether.c:437 [inline] lapbeth_device_event+0x94c/0xd40 drivers/net/wan/lapbether.c:472 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] unregister_netdevice_many_notify+0x8a1/0x19f0 net/core/dev.c:11105 Memory state around the buggy address: ffff888055cd9600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888055cd9680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888055cd9700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888055cd9780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888055cd9800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================