================================================================== BUG: KASAN: use-after-free in __bfs+0x154/0x394 kernel/locking/lockdep.c:1708 Read of size 8 at addr ffffaf801098bd50 by task kworker/0:3/2659 CPU: 0 PID: 2659 Comm: kworker/0:3 Not tainted 5.17.0-rc1-syzkaller-00002-g0966d385830d #0 Hardware name: riscv-virtio,qemu (DT) Workqueue: usb_hub_wq hub_event Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:113 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:119 [] __dump_stack lib/dump_stack.c:88 [inline] [] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:106 [] print_address_description.constprop.0+0x2a/0x330 mm/kasan/report.c:255 [] __kasan_report mm/kasan/report.c:442 [inline] [] kasan_report+0x184/0x1e0 mm/kasan/report.c:459 [] check_region_inline mm/kasan/generic.c:183 [inline] [] __asan_load8+0x6e/0x96 mm/kasan/generic.c:256 [] __bfs+0x154/0x394 kernel/locking/lockdep.c:1708 [] __bfs_forwards kernel/locking/lockdep.c:1803 [inline] [] check_path.constprop.0+0x24/0x46 kernel/locking/lockdep.c:2104 [] check_noncircular+0x11a/0x1fe kernel/locking/lockdep.c:2131 [] check_prev_add kernel/locking/lockdep.c:3063 [inline] [] check_prevs_add kernel/locking/lockdep.c:3186 [inline] [] validate_chain kernel/locking/lockdep.c:3801 [inline] [] __lock_acquire+0x19a4/0x333e kernel/locking/lockdep.c:5027 [] lock_acquire.part.0+0x1d0/0x424 kernel/locking/lockdep.c:5639 Allocated by task 14: (stack is not available) Last potentially related work creation: stack_trace_save+0xa6/0xd8 kernel/stacktrace.c:122 kasan_save_stack+0x2c/0x58 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x8e/0x98 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc+0x338/0x3de mm/slub.c:3243 kmem_cache_zalloc include/linux/slab.h:705 [inline] __kernfs_new_node+0xfc/0x5f2 fs/kernfs/dir.c:585 kernfs_new_node+0x66/0xbe fs/kernfs/dir.c:647 __kernfs_create_file+0x4e/0x1e8 fs/kernfs/file.c:987 sysfs_add_file_mode_ns+0x138/0x254 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x274/0x722 fs/sysfs/group.c:148 sysfs_create_group+0x22/0x2e fs/sysfs/group.c:174 numa_init_sysfs+0x76/0xc0 mm/migrate.c:3351 do_one_initcall+0x13a/0x7ea init/main.c:1300 do_initcall_level init/main.c:1373 [inline] do_initcalls init/main.c:1389 [inline] do_basic_setup init/main.c:1408 [inline] kernel_init_freeable+0x510/0x5b4 init/main.c:1613 kernel_init+0x28/0x21c init/main.c:1502 ret_from_exception+0x0/0x10 The buggy address belongs to the object at ffffaf801098bc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 336 bytes inside of 512-byte region [ffffaf801098bc00, ffffaf801098be00) The buggy address belongs to the page: page:ffffaf807aaf3e40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x90b88 head:ffffaf807aaf3e40 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x9000010200(slab|head|section=18|node=0|zone=0) raw: 0000009000010200 0000000000000100 0000000000000122 ffffaf8007201c80 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 raw: 00000000000007ff page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2057, ts 1329585891100, free_ts 1316951447000 __set_page_owner+0x48/0x136 mm/page_owner.c:183 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0xd0/0x10a mm/page_alloc.c:2427 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0x8da/0x12d8 mm/page_alloc.c:4165 __alloc_pages+0x150/0x3b6 mm/page_alloc.c:5389 alloc_pages+0x132/0x2a6 mm/mempolicy.c:2271 alloc_slab_page.constprop.0+0xc2/0xfa mm/slub.c:1799 allocate_slab mm/slub.c:1944 [inline] new_slab+0x25a/0x2cc mm/slub.c:2004 ___slab_alloc+0x56e/0x918 mm/slub.c:3018 __slab_alloc.constprop.0+0x50/0x8c mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] __kmalloc_node_track_caller+0x26c/0x362 mm/slub.c:4957 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xee/0x2e4 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1158 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet6_netconf_notify_devconf+0xb6/0x1f2 net/ipv6/addrconf.c:584 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7064 [inline] addrconf_sysctl_unregister+0xaa/0xdc net/ipv6/addrconf.c:7088 addrconf_notify+0x50e/0x1360 net/ipv6/addrconf.c:3657 notifier_call_chain+0xb8/0x188 kernel/notifier.c:84 raw_notifier_call_chain+0x2a/0x38 kernel/notifier.c:392 page last free stack trace: __reset_page_owner+0x4a/0xea mm/page_owner.c:142 reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0x29c/0x45e mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x6a/0x31e mm/page_alloc.c:3404 free_the_page mm/page_alloc.c:706 [inline] __free_pages+0xe2/0x112 mm/page_alloc.c:5474 __free_slab+0x122/0x27c mm/slub.c:2028 free_slab mm/slub.c:2043 [inline] discard_slab+0x4c/0x7a mm/slub.c:2049 __slab_free+0x20a/0x29c mm/slub.c:3414 do_slab_free mm/slub.c:3497 [inline] ___cache_free+0x17c/0x354 mm/slub.c:3516 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x7c/0x132 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x14c/0x1c8 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x5c/0x98 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc_trace+0x278/0x2e0 mm/slub.c:3255 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:715 [inline] mca_alloc net/ipv6/mcast.c:880 [inline] __ipv6_dev_mc_inc+0x2c4/0x924 net/ipv6/mcast.c:936 ipv6_dev_mc_inc+0x22/0x2e net/ipv6/mcast.c:957 ipv6_add_dev+0x64e/0xa7e net/ipv6/addrconf.c:465 addrconf_notify+0x5e8/0x1360 net/ipv6/addrconf.c:3510 Memory state around the buggy address: ffffaf801098bc00: f1 f1 f1 f1 00 f3 f3 f3 fb fb fb fb fb fb fb fb ffffaf801098bc80: fb fb fb fb fb fb fb fb fb fb fb fb 00 00 00 00 >ffffaf801098bd00: f1 f1 f1 f1 00 f2 f2 f2 fb fb fb fb 00 00 00 f3 ^ ffffaf801098bd80: f3 f3 f3 f3 fb fb fb fb fb fb fb fb fb fb fb fb ffffaf801098be00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================