================================================================== BUG: KASAN: slab-out-of-bounds in xfrm_policy_inexact_list_reinsert+0x5b5/0x660 net/xfrm/xfrm_policy.c:874 Read of size 1 at addr ffff88814ca3d600 by task syz.0.10/4269 CPU: 1 PID: 4269 Comm: syz.0.10 Not tainted 5.15.177-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 xfrm_policy_inexact_list_reinsert+0x5b5/0x660 net/xfrm/xfrm_policy.c:874 xfrm_policy_inexact_node_merge net/xfrm/xfrm_policy.c:1006 [inline] xfrm_policy_inexact_insert_node+0x8e7/0xb00 net/xfrm/xfrm_policy.c:1062 xfrm_policy_inexact_alloc_chain+0x5ff/0xe20 net/xfrm/xfrm_policy.c:1178 xfrm_policy_inexact_insert+0xe1/0x13c0 net/xfrm/xfrm_policy.c:1221 xfrm_policy_insert+0xe1/0x920 net/xfrm/xfrm_policy.c:1602 xfrm_add_policy+0x4f2/0x9b0 net/xfrm/xfrm_user.c:1833 xfrm_user_rcv_msg+0x6ea/0xa40 net/xfrm/xfrm_user.c:2979 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2489 xfrm_netlink_rcv+0x70/0x80 net/xfrm/xfrm_user.c:3001 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1337 netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2436 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2490 __sys_sendmsg net/socket.c:2519 [inline] __do_sys_sendmsg net/socket.c:2528 [inline] __se_sys_sendmsg+0x19a/0x260 net/socket.c:2526 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f7db6f6bda9 Code: ff ff 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 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7db4dd5038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f7db7184fa0 RCX: 00007f7db6f6bda9 RDX: 0000000000004000 RSI: 0000000020000580 RDI: 0000000000000006 RBP: 00007f7db6fed2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f7db7184fa0 R15: 00007ffc1e2bc3c8 Allocated by task 4269: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x168/0x300 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0xe0/0x200 net/core/sock.c:1866 sk_alloc+0x35/0x310 net/core/sock.c:1919 pfkey_create+0xda/0x580 net/key/af_key.c:152 __sock_create+0x460/0x8f0 net/socket.c:1486 sock_create net/socket.c:1542 [inline] __sys_socket+0x132/0x370 net/socket.c:1584 __do_sys_socket net/socket.c:1593 [inline] __se_sys_socket net/socket.c:1591 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1591 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3087 netlink_release+0x143c/0x18d0 net/netlink/af_netlink.c:800 __sock_release net/socket.c:649 [inline] sock_close+0xcd/0x230 net/socket.c:1336 __fput+0x3fe/0x8e0 fs/file_table.c:280 task_work_run+0x129/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88814ca3d000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1536 bytes inside of 2048-byte region [ffff88814ca3d000, ffff88814ca3d800) The buggy address belongs to the page: page:ffffea0005328e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14ca38 head:ffffea0005328e00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x57ff00000010200(slab|head|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000010200 ffffea0005076c00 0000000200000002 ffff888017442000 raw: 0000000000000000 0000000000080008 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, ts 10759712119, free_ts 0 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192 __alloc_pages+0x272/0x700 mm/page_alloc.c:5465 alloc_page_interleave+0x22/0x1c0 mm/mempolicy.c:2031 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc_track_caller+0x1c7/0x300 mm/slub.c:4925 kmemdup+0x21/0x50 mm/util.c:128 neigh_sysctl_register+0xb0/0x530 net/core/neighbour.c:3648 devinet_sysctl_register+0x9d/0x1a0 net/ipv4/devinet.c:2640 inetdev_init+0x282/0x4a0 net/ipv4/devinet.c:277 inetdev_event+0x29b/0x1490 net/ipv4/devinet.c:1543 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2018 [inline] call_netdevice_notifiers_extack net/core/dev.c:2030 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2044 register_netdevice+0x12e8/0x1720 net/core/dev.c:10396 register_netdev+0x37/0x50 net/core/dev.c:10489 sit_init_net+0x1f7/0x4d0 net/ipv6/sit.c:1925 page_owner free stack trace missing Memory state around the buggy address: ffff88814ca3d500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88814ca3d580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc >ffff88814ca3d600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88814ca3d680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88814ca3d700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================