================================================================== BUG: KASAN: slab-out-of-bounds in memset include/linux/string.h:384 [inline] BUG: KASAN: slab-out-of-bounds in xfrm_attr_cpy32+0x15a/0x1d0 net/xfrm/xfrm_compat.c:393 Write of size 4 at addr ffff8880230df2ec by task syz-executor.1/7405 CPU: 1 PID: 7405 Comm: syz-executor.1 Not tainted 5.10.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0x13d/0x180 mm/kasan/generic.c:192 memset+0x20/0x40 mm/kasan/common.c:84 memset include/linux/string.h:384 [inline] xfrm_attr_cpy32+0x15a/0x1d0 net/xfrm/xfrm_compat.c:393 xfrm_xlate32_attr net/xfrm/xfrm_compat.c:426 [inline] xfrm_xlate32 net/xfrm/xfrm_compat.c:525 [inline] xfrm_user_rcv_msg_compat+0x76b/0x1040 net/xfrm/xfrm_compat.c:570 xfrm_user_rcv_msg+0x55b/0x8b0 net/xfrm/xfrm_user.c:2714 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 xfrm_netlink_rcv+0x6b/0x90 net/xfrm/xfrm_user.c:2764 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2353 ___sys_sendmsg+0xf3/0x170 net/socket.c:2407 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:137 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:160 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf7fa7549 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 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f55a10cc EFLAGS: 00000296 ORIG_RAX: 0000000000000172 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000020000700 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 7405: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461 kmalloc_node include/linux/slab.h:575 [inline] kvmalloc_node+0x61/0xf0 mm/util.c:575 kvmalloc include/linux/mm.h:765 [inline] xfrm_user_rcv_msg_compat+0x3cd/0x1040 net/xfrm/xfrm_compat.c:566 xfrm_user_rcv_msg+0x55b/0x8b0 net/xfrm/xfrm_user.c:2714 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 xfrm_netlink_rcv+0x6b/0x90 net/xfrm/xfrm_user.c:2764 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2353 ___sys_sendmsg+0xf3/0x170 net/socket.c:2407 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:137 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:160 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0xc0/0xf0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2953 [inline] call_rcu+0xbb/0x700 kernel/rcu/tree.c:3027 fib6_info_release include/net/ip6_fib.h:336 [inline] fib6_info_release include/net/ip6_fib.h:333 [inline] __ip6_del_rt net/ipv6/route.c:3768 [inline] ip6_del_rt+0x1be/0x200 net/ipv6/route.c:3779 __ipv6_ifa_notify+0x4f3/0xa90 net/ipv6/addrconf.c:6080 ipv6_ifa_notify+0xf0/0x1f0 net/ipv6/addrconf.c:6093 ipv6_del_addr+0x3e0/0x9e0 net/ipv6/addrconf.c:1292 inet6_addr_del+0x2e3/0x5a0 net/ipv6/addrconf.c:3003 addrconf_del_ifaddr+0xf5/0x160 net/ipv6/addrconf.c:3054 inet6_ioctl+0x1d4/0x280 net/ipv6/af_inet6.c:566 sock_do_ioctl+0xcb/0x2d0 net/socket.c:1047 compat_ifreq_ioctl net/socket.c:3310 [inline] compat_sock_ioctl_trans net/socket.c:3475 [inline] compat_sock_ioctl+0x49b/0x1d30 net/socket.c:3508 __do_compat_sys_ioctl+0x1d3/0x230 fs/ioctl.c:842 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:137 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:160 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Second to last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0xc0/0xf0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2953 [inline] call_rcu+0xbb/0x700 kernel/rcu/tree.c:3027 free_fib_info net/ipv4/fib_semantics.c:256 [inline] fib_create_info+0x20c5/0x4a30 net/ipv4/fib_semantics.c:1548 fib_table_insert+0x1ce/0x1af0 net/ipv4/fib_trie.c:1189 fib_magic+0x3b9/0x520 net/ipv4/fib_frontend.c:1085 fib_add_ifaddr+0x16c/0x520 net/ipv4/fib_frontend.c:1107 fib_netdev_event+0x488/0x670 net/ipv4/fib_frontend.c:1466 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2035 call_netdevice_notifiers_extack net/core/dev.c:2047 [inline] call_netdevice_notifiers net/core/dev.c:2061 [inline] __dev_notify_flags+0x110/0x2b0 net/core/dev.c:8461 dev_change_flags+0x100/0x160 net/core/dev.c:8499 do_setlink+0x88b/0x3a70 net/core/rtnetlink.c:2706 __rtnl_newlink+0xc1c/0x1740 net/core/rtnetlink.c:3374 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3500 rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5562 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 __sys_sendto+0x21c/0x320 net/socket.c:1992 __do_compat_sys_socketcall+0x47f/0x660 net/compat.c:476 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:137 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:160 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c The buggy address belongs to the object at ffff8880230df200 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 236 bytes inside of 256-byte region [ffff8880230df200, ffff8880230df300) The buggy address belongs to the page: page:000000000d8cb204 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880230de200 pfn:0x230de head:000000000d8cb204 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 ffffea00007f9980 0000000300000003 ffff8880100413c0 raw: ffff8880230de200 000000008010000f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880230df180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880230df200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880230df280: 00 00 00 00 00 00 00 00 00 00 00 00 00 04 fc fc ^ ffff8880230df300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880230df380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================