================================================================== BUG: KASAN: slab-out-of-bounds in pfkey_msg2xfrm_state net/key/af_key.c:1227 [inline] BUG: KASAN: slab-out-of-bounds in pfkey_add+0x1481/0x3230 net/key/af_key.c:1506 Read of size 5536 at addr ffff8801cb9187c0 by task syz-executor0/4083 CPU: 0 PID: 4083 Comm: syz-executor0 Not tainted 4.9.108-gb7d377b #50 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801b7a4f6e0 ffffffff81eb3e29 ffffea00072e4600 ffff8801cb9187c0 0000000000000000 ffff8801cb918980 ffff8801cb918780 ffff8801b7a4f718 ffffffff81567a89 ffff8801cb9187c0 00000000000015a0 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x6c/0x234 mm/kasan/report.c:256 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=8293 sclass=netlink_route_socket pig=4086 comm=syz-executor4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=8293 sclass=netlink_route_socket pig=4087 comm=syz-executor4 [] kasan_report_error mm/kasan/report.c:355 [inline] [] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412 [] check_memory_region_inline mm/kasan/kasan.c:318 [inline] [] check_memory_region+0x14f/0x1b0 mm/kasan/kasan.c:325 [] memcpy+0x23/0x50 mm/kasan/kasan.c:360 [] pfkey_msg2xfrm_state net/key/af_key.c:1227 [inline] [] pfkey_add+0x1481/0x3230 net/key/af_key.c:1506 [] pfkey_process+0x671/0x740 net/key/af_key.c:2834 [] pfkey_sendmsg+0x346/0xae0 net/key/af_key.c:3678 [] sock_sendmsg_nosec net/socket.c:635 [inline] [] sock_sendmsg+0xcc/0x110 net/socket.c:645 [] ___sys_sendmsg+0x6fc/0x840 net/socket.c:1969 [] __sys_sendmsg+0xd9/0x190 net/socket.c:2003 [] SYSC_sendmsg net/socket.c:2014 [inline] [] SyS_sendmsg+0x2d/0x50 net/socket.c:2010 [] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Allocated by task 4083: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:609 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:547 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] slab_alloc mm/slub.c:2723 [inline] __kmalloc_track_caller+0xdc/0x2b0 mm/slub.c:4232 __kmalloc_reserve.isra.37+0x33/0xc0 net/core/skbuff.c:138 __alloc_skb+0x11a/0x600 net/core/skbuff.c:231 alloc_skb include/linux/skbuff.h:919 [inline] pfkey_sendmsg+0xfe/0xae0 net/key/af_key.c:3665 sock_sendmsg_nosec net/socket.c:635 [inline] sock_sendmsg+0xcc/0x110 net/socket.c:645 ___sys_sendmsg+0x6fc/0x840 net/socket.c:1969 __sys_sendmsg+0xd9/0x190 net/socket.c:2003 SYSC_sendmsg net/socket.c:2014 [inline] SyS_sendmsg+0x2d/0x50 net/socket.c:2010 do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x5d/0xdb Freed by task 2674: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0xfb/0x310 mm/slub.c:3878 skb_free_head+0x8b/0xb0 net/core/skbuff.c:580 skb_release_data+0x329/0x400 net/core/skbuff.c:611 skb_release_all+0x4a/0x60 net/core/skbuff.c:670 __kfree_skb net/core/skbuff.c:684 [inline] consume_skb+0xc6/0x340 net/core/skbuff.c:757 netlink_broadcast_filtered+0x2ae/0x9f0 net/netlink/af_netlink.c:1479 netlink_broadcast net/netlink/af_netlink.c:1501 [inline] nlmsg_multicast include/net/netlink.h:576 [inline] nlmsg_notify+0x97/0x150 net/netlink/af_netlink.c:2401 rtnl_notify+0xbb/0xe0 net/core/rtnetlink.c:674 rtmsg_fib+0x304/0x460 net/ipv4/fib_semantics.c:423 fib_table_delete+0x66c/0xe40 net/ipv4/fib_trie.c:1569 fib_magic.isra.23+0x1f6/0x330 net/ipv4/fib_frontend.c:846 fib_del_ifaddr+0x737/0x1540 net/ipv4/fib_frontend.c:930 fib_inetaddr_event+0xaf/0x200 net/ipv4/fib_frontend.c:1156 notifier_call_chain+0xb4/0x1d0 kernel/notifier.c:93 __blocking_notifier_call_chain kernel/notifier.c:317 [inline] blocking_notifier_call_chain+0x7e/0xa0 kernel/notifier.c:328 __inet_del_ifa+0x4cf/0xb20 net/ipv4/devinet.c:403 inet_del_ifa net/ipv4/devinet.c:433 [inline] devinet_ioctl+0x14b3/0x15d0 net/ipv4/devinet.c:1074 inet_ioctl+0x11e/0x1d0 net/ipv4/af_inet.c:908 packet_ioctl+0x176/0x280 net/packet/af_packet.c:4115 sock_do_ioctl+0x6a/0xb0 net/socket.c:892 sock_ioctl+0x346/0x3e0 net/socket.c:978 vfs_ioctl fs/ioctl.c:43 [inline] file_ioctl fs/ioctl.c:493 [inline] do_vfs_ioctl+0x1ac/0x11a0 fs/ioctl.c:677 SYSC_ioctl fs/ioctl.c:694 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x5d/0xdb The buggy address belongs to the object at ffff8801cb918780 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 64 bytes inside of 512-byte region [ffff8801cb918780, ffff8801cb918980) The buggy address belongs to the page: page:ffffea00072e4600 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x8000000000004080(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801cb918880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801cb918900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8801cb918980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8801cb918a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801cb918a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================