================================================================== BUG: KASAN: slab-out-of-bounds in ___bpf_prog_run+0x7f35/0x8fd0 kernel/bpf/core.c:1937 Read of size 4 at addr ffff88801cadf880 by task a.out/6957 CPU: 1 PID: 6957 Comm: a.out Not tainted 6.1.0-rc8-02212-gef3911a3e4d6-dirty #137 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Arch Linux 1.16.1-1-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x100/0x178 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x167/0x46c mm/kasan/report.c:395 kasan_report+0xbf/0x1e0 mm/kasan/report.c:495 ___bpf_prog_run+0x7f35/0x8fd0 kernel/bpf/core.c:1937 __bpf_prog_run32+0x9d/0xe0 kernel/bpf/core.c:2045 bpf_dispatcher_nop_func include/linux/bpf.h:1082 [inline] __bpf_prog_run include/linux/filter.h:600 [inline] bpf_prog_run include/linux/filter.h:607 [inline] bpf_test_run+0x38e/0x980 net/bpf/test_run.c:402 bpf_prog_test_run_skb+0xb67/0x1dc0 net/bpf/test_run.c:1187 bpf_prog_test_run kernel/bpf/syscall.c:3644 [inline] __sys_bpf+0x1293/0x5840 kernel/bpf/syscall.c:4997 __do_sys_bpf kernel/bpf/syscall.c:5083 [inline] __se_sys_bpf kernel/bpf/syscall.c:5081 [inline] __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5081 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f39e82e4469 Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 8b 0d ff 49 2b 00 f7 d8 64 89 01 48 RSP: 002b:00007ffef1a4e978 EFLAGS: 00000203 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f39e82e4469 RDX: 0000000000000025 RSI: 0000000020000200 RDI: 000000000000000a RBP: 00007ffef1a4e990 R08: 00007f39e832dd70 R09: 00007ffef1a4e990 R10: 000000002000018b R11: 0000000000000203 R12: 000056382f400bc0 R13: 00007ffef1a4eab0 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 6956: kasan_save_stack+0x20/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x84/0x90 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] kmem_cache_alloc_node+0x166/0x410 mm/slub.c:3443 alloc_task_struct_node kernel/fork.c:171 [inline] dup_task_struct kernel/fork.c:966 [inline] copy_process+0x5db/0x6f40 kernel/fork.c:2084 kernel_clone+0xe8/0x980 kernel/fork.c:2671 __do_sys_clone+0xc0/0x100 kernel/fork.c:2812 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x20/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbf/0xd0 mm/kasan/generic.c:481 call_rcu+0x9e/0x790 kernel/rcu/tree.c:2798 put_task_struct_rcu_user kernel/exit.c:184 [inline] put_task_struct_rcu_user+0x83/0xc0 kernel/exit.c:181 release_task+0xe9e/0x1ae0 kernel/exit.c:234 wait_task_zombie kernel/exit.c:1136 [inline] wait_consider_task+0x17d8/0x3e70 kernel/exit.c:1363 do_wait_thread kernel/exit.c:1426 [inline] do_wait+0x75f/0xdc0 kernel/exit.c:1543 kernel_wait4+0x153/0x260 kernel/exit.c:1706 __do_sys_wait4+0x147/0x160 kernel/exit.c:1734 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88801cadd880 which belongs to the cache task_struct of size 7240 The buggy address is located 952 bytes to the right of 7240-byte region [ffff88801cadd880, ffff88801cadf4c8) The buggy address belongs to the physical page: page:ffffea000072b600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1cad8 head:ffffea000072b600 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff88802128b8c1 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888100080000 raw: 0000000000000000 0000000080040004 00000001ffffffff ffff88802128b8c1 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3105, tgid 3105 (systemd-udevd), ts 20855610686, free_ts 20852392721 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10ce/0x2db0 mm/page_alloc.c:4291 __alloc_pages+0x1c8/0x5c0 mm/page_alloc.c:5558 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x24e/0x340 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0x89a/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] kmem_cache_alloc_node+0x12e/0x410 mm/slub.c:3443 alloc_task_struct_node kernel/fork.c:171 [inline] dup_task_struct kernel/fork.c:966 [inline] copy_process+0x5db/0x6f40 kernel/fork.c:2084 kernel_clone+0xe8/0x980 kernel/fork.c:2671 __do_sys_clone+0xc0/0x100 kernel/fork.c:2812 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x44c/0xb30 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x1d/0x510 mm/page_alloc.c:3483 __unfreeze_partials+0x18d/0x1b0 mm/slub.c:2586 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x17a/0x1b0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x68/0x90 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x155/0x3d0 mm/slub.c:3422 vm_area_dup+0x85/0x380 kernel/fork.c:466 dup_mmap+0x65e/0x1110 kernel/fork.c:640 dup_mm+0x8e/0x350 kernel/fork.c:1526 copy_mm kernel/fork.c:1575 [inline] copy_process+0x3c33/0x6f40 kernel/fork.c:2253 kernel_clone+0xe8/0x980 kernel/fork.c:2671 __do_sys_clone+0xc0/0x100 kernel/fork.c:2812 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88801cadf780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801cadf800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801cadf880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801cadf900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801cadf980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================