================================================================== BUG: KASAN: slab-out-of-bounds in btf_name_valid_section kernel/bpf/btf.c:829 [inline] BUG: KASAN: slab-out-of-bounds in btf_datasec_check_meta+0x8ff/0x910 kernel/bpf/btf.c:4698 Read of size 1 at addr ffff888049c94eb9 by task syz.2.2250/13329 CPU: 3 UID: 0 PID: 13329 Comm: syz.2.2250 Not tainted 6.11.0-rc5-syzkaller-00219-g1934261d8974 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 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 btf_name_valid_section kernel/bpf/btf.c:829 [inline] btf_datasec_check_meta+0x8ff/0x910 kernel/bpf/btf.c:4698 btf_check_meta kernel/bpf/btf.c:5180 [inline] btf_check_all_metas kernel/bpf/btf.c:5204 [inline] btf_parse_type_sec kernel/bpf/btf.c:5340 [inline] btf_parse kernel/bpf/btf.c:5732 [inline] btf_new_fd+0x173f/0x4f20 kernel/bpf/btf.c:7650 bpf_btf_load kernel/bpf/syscall.c:5035 [inline] __sys_bpf+0x1bc8/0x55e0 kernel/bpf/syscall.c:5755 __do_sys_bpf kernel/bpf/syscall.c:5817 [inline] __se_sys_bpf kernel/bpf/syscall.c:5815 [inline] __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5815 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf740e579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f571656c EFLAGS: 00000296 ORIG_RAX: 0000000000000165 RAX: ffffffffffffffda RBX: 0000000000000012 RCX: 0000000020000000 RDX: 0000000000000020 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 13329: 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: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:4158 [inline] __kmalloc_node_noprof+0x211/0x440 mm/slub.c:4164 __kvmalloc_node_noprof+0x9d/0x1a0 mm/util.c:650 btf_parse kernel/bpf/btf.c:5708 [inline] btf_new_fd+0x651/0x4f20 kernel/bpf/btf.c:7650 bpf_btf_load kernel/bpf/syscall.c:5035 [inline] __sys_bpf+0x1bc8/0x55e0 kernel/bpf/syscall.c:5755 __do_sys_bpf kernel/bpf/syscall.c:5817 [inline] __se_sys_bpf kernel/bpf/syscall.c:5815 [inline] __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5815 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888049c94e80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes to the right of allocated 57-byte region [ffff888049c94e80, ffff888049c94eb9) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x49c94 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 04fff00000000000 ffff88801ac428c0 ffffea0001c4c640 dead000000000004 raw: 0000000000000000 0000000080200020 00000001fdffffff 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 5361, tgid 5361 (syz-executor), ts 67416666981, free_ts 66907195431 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3439 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4695 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x4e/0xf0 mm/slub.c:2321 allocate_slab mm/slub.c:2484 [inline] new_slab+0x84/0x260 mm/slub.c:2537 ___slab_alloc+0xdac/0x1870 mm/slub.c:3723 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __do_kmalloc_node mm/slub.c:4157 [inline] __kmalloc_noprof+0x379/0x410 mm/slub.c:4170 kmalloc_noprof include/linux/slab.h:685 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] kobject_get_path+0xcb/0x230 lib/kobject.c:161 kobject_uevent_env+0x289/0x1670 lib/kobject_uevent.c:545 rx_queue_add_kobject net/core/net-sysfs.c:1120 [inline] net_rx_queue_update_kobjects+0x17a/0x5f0 net/core/net-sysfs.c:1160 register_queue_kobjects net/core/net-sysfs.c:1895 [inline] netdev_register_kobject+0x26d/0x3f0 net/core/net-sysfs.c:2140 register_netdevice+0x1473/0x1e20 net/core/dev.c:10444 veth_newlink+0x4fb/0x9e0 drivers/net/veth.c:1860 rtnl_newlink_create net/core/rtnetlink.c:3510 [inline] __rtnl_newlink+0x119c/0x1920 net/core/rtnetlink.c:3730 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3743 page last free pid 5357 tgid 5357 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2612 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4044 __kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:624 kernfs_new_node+0x186/0x240 fs/kernfs/dir.c:700 __kernfs_create_file+0x53/0x350 fs/kernfs/file.c:1034 sysfs_add_file_mode_ns+0x1ff/0x3b0 fs/sysfs/file.c:307 create_files fs/sysfs/group.c:76 [inline] internal_create_group+0x565/0xe50 fs/sysfs/group.c:180 internal_create_groups+0x9d/0x150 fs/sysfs/group.c:220 create_dir lib/kobject.c:78 [inline] kobject_add_internal+0x317/0x990 lib/kobject.c:240 kobject_add_varg lib/kobject.c:374 [inline] kobject_init_and_add+0x11c/0x190 lib/kobject.c:457 netdev_queue_add_kobject net/core/net-sysfs.c:1786 [inline] netdev_queue_update_kobjects+0x2d1/0x640 net/core/net-sysfs.c:1838 register_queue_kobjects net/core/net-sysfs.c:1900 [inline] netdev_register_kobject+0x290/0x3f0 net/core/net-sysfs.c:2140 register_netdevice+0x1473/0x1e20 net/core/dev.c:10444 Memory state around the buggy address: ffff888049c94d80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888049c94e00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc >ffff888049c94e80: 00 00 00 00 00 00 00 01 fc fc fc fc fc fc fc fc ^ ffff888049c94f00: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff888049c94f80: 00 00 00 00 02 fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi