================================================================== BUG: KASAN: slab-out-of-bounds in __skb_frag_set_page include/linux/skbuff.h:3242 [inline] BUG: KASAN: slab-out-of-bounds in bpf_prog_test_run_xdp+0xf9a/0x1010 net/bpf/test_run.c:942 Write of size 8 at addr ffff88807d16f000 by task syz-executor365/4053 CPU: 0 PID: 4053 Comm: syz-executor365 Not tainted 5.16.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 __skb_frag_set_page include/linux/skbuff.h:3242 [inline] bpf_prog_test_run_xdp+0xf9a/0x1010 net/bpf/test_run.c:942 bpf_prog_test_run kernel/bpf/syscall.c:3357 [inline] __sys_bpf+0x1054/0x4410 kernel/bpf/syscall.c:4659 __do_sys_bpf kernel/bpf/syscall.c:4745 [inline] __se_sys_bpf kernel/bpf/syscall.c:4743 [inline] __x64_sys_bpf+0x70/0xb0 kernel/bpf/syscall.c:4743 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fd9171e8d59 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 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 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fffbefdbd58 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fd9171e8d59 RDX: 0000000000000048 RSI: 0000000020000000 RDI: 000000000000000a RBP: 00007fd9171acf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd9171acf90 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 4053: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc include/linux/slab.h:587 [inline] kzalloc include/linux/slab.h:716 [inline] bpf_test_init.isra.0+0x4c/0xb0 net/bpf/test_run.c:382 bpf_prog_test_run_xdp+0x2a9/0x1010 net/bpf/test_run.c:911 bpf_prog_test_run kernel/bpf/syscall.c:3357 [inline] __sys_bpf+0x1054/0x4410 kernel/bpf/syscall.c:4659 __do_sys_bpf kernel/bpf/syscall.c:4745 [inline] __se_sys_bpf kernel/bpf/syscall.c:4743 [inline] __x64_sys_bpf+0x70/0xb0 kernel/bpf/syscall.c:4743 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88807d16e000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 0 bytes to the right of 4096-byte region [ffff88807d16e000, ffff88807d16f000) The buggy address belongs to the page: page:ffffea0001f45a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7d168 head:ffffea0001f45a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff88800fc42140 raw: 0000000000000000 0000000080040004 00000001ffffffff 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 8, ts 51905196458, free_ts 51586417134 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa6f/0x2f10 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0x28a/0x3b0 mm/slub.c:2004 ___slab_alloc+0x87e/0xe80 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] __kmalloc_node_track_caller+0x2cb/0x360 mm/slub.c:4957 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0x8a/0x270 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1159 [inline] nlmsg_new include/net/netlink.h:953 [inline] rtmsg_ifinfo_build_skb+0x6d/0x160 net/core/rtnetlink.c:3829 rtmsg_ifinfo_event net/core/rtnetlink.c:3865 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3856 [inline] rtmsg_ifinfo+0x5c/0x100 net/core/rtnetlink.c:3874 register_netdevice+0xe38/0x1240 net/core/dev.c:9706 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:317 [inline] nsim_create+0x371/0x4b0 drivers/net/netdevsim/netdev.c:365 __nsim_dev_port_add+0x250/0x6e0 drivers/net/netdevsim/dev.c:1392 nsim_dev_port_add_all+0x36/0x120 drivers/net/netdevsim/dev.c:1452 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1501 [inline] nsim_dev_reload_up+0x496/0x670 drivers/net/netdevsim/dev.c:991 devlink_reload+0x27d/0x5e0 net/core/devlink.c:4079 devlink_pernet_pre_exit+0x141/0x1c0 net/core/devlink.c:11424 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3388 __unfreeze_partials+0x320/0x340 mm/slub.c:2536 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5e/0xf0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:738 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc_trace+0x1e9/0x2c0 mm/slub.c:3255 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:716 [inline] nsim_fib6_rt_create drivers/net/netdevsim/fib.c:544 [inline] nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:749 [inline] nsim_fib6_event drivers/net/netdevsim/fib.c:853 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:886 [inline] nsim_fib_event_work+0x1003/0x20e0 drivers/net/netdevsim/fib.c:1477 process_one_work+0x87f/0x1420 kernel/workqueue.c:2298 process_scheduled_works kernel/workqueue.c:2361 [inline] worker_thread+0x741/0xf90 kernel/workqueue.c:2447 kthread+0x3ab/0x480 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88807d16ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807d16ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807d16f000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807d16f080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807d16f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================