================================================================== 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 ffff88807d29c600 by task syz.1.3195/22052 CPU: 0 PID: 22052 Comm: syz.1.3195 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:0x7fd594235da9 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:00007fd59207e038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fd59444f080 RCX: 00007fd594235da9 RDX: 0000000000004000 RSI: 0000000020000580 RDI: 0000000000000007 RBP: 00007fd5942b72a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd59444f080 R15: 00007ffc67a4d218 Allocated by task 22052: 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 __vlan_del+0x731/0x8d0 net/bridge/br_vlan.c:388 __vlan_flush net/bridge/br_vlan.c:420 [inline] br_vlan_flush+0x242/0x3c0 net/bridge/br_vlan.c:787 br_dev_uninit+0x2a/0x70 net/bridge/br_device.c:170 unregister_netdevice_many+0x12bb/0x18f0 net/core/dev.c:11119 default_device_exit_batch+0x390/0x3f0 net/core/dev.c:11635 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x886/0xc90 net/core/net_namespace.c:618 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Second to 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 __vlan_del+0x731/0x8d0 net/bridge/br_vlan.c:388 __vlan_flush net/bridge/br_vlan.c:420 [inline] br_vlan_flush+0x242/0x3c0 net/bridge/br_vlan.c:787 br_dev_uninit+0x2a/0x70 net/bridge/br_device.c:170 unregister_netdevice_many+0x12bb/0x18f0 net/core/dev.c:11119 default_device_exit_batch+0x390/0x3f0 net/core/dev.c:11635 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x886/0xc90 net/core/net_namespace.c:618 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff88807d29c000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1536 bytes inside of 2048-byte region [ffff88807d29c000, ffff88807d29c800) The buggy address belongs to the page: page:ffffea0001f4a600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7d298 head:ffffea0001f4a600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 0000000500000001 ffff888017442000 raw: 0000000000000000 0000000080080008 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4166, ts 65088670483, free_ts 65052266744 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_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] __kmalloc_node_track_caller+0x1f6/0x390 mm/slub.c:4958 kmalloc_reserve net/core/skbuff.c:356 [inline] pskb_expand_head+0x111/0x1130 net/core/skbuff.c:1709 netlink_trim+0x183/0x220 net/netlink/af_netlink.c:1293 netlink_broadcast_filtered+0x62/0x11a0 net/netlink/af_netlink.c:1498 netlink_broadcast net/netlink/af_netlink.c:1543 [inline] nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0xf7/0x1b0 net/netlink/af_netlink.c:2532 __dev_notify_flags+0xdd/0x610 net/core/dev.c:8855 dev_change_flags+0xe7/0x190 net/core/dev.c:8897 do_setlink+0xc21/0x3d80 net/core/rtnetlink.c:2776 __rtnl_newlink net/core/rtnetlink.c:3447 [inline] rtnl_newlink+0x17d6/0x2070 net/core/rtnetlink.c:3569 rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5647 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2489 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1337 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 free_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587 do_slab_free mm/slub.c:3487 [inline] ___cache_free+0xe3/0x100 mm/slub.c:3506 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc_trace+0xfb/0x290 mm/slub.c:3245 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] devlink_trap_register net/core/devlink.c:10909 [inline] devlink_traps_register+0x3dc/0xa60 net/core/devlink.c:11001 nsim_dev_traps_init+0x26a/0x500 drivers/net/netdevsim/dev.c:815 nsim_dev_probe+0x61e/0x9f0 drivers/net/netdevsim/dev.c:1487 really_probe+0x24e/0xb60 drivers/base/dd.c:595 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755 driver_probe_device+0x50/0x420 drivers/base/dd.c:785 Memory state around the buggy address: ffff88807d29c500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807d29c580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc >ffff88807d29c600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807d29c680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807d29c700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================