================================================================== BUG: KASAN: slab-out-of-bounds in pfkey_msg2xfrm_state net/key/af_key.c:1219 [inline] BUG: KASAN: slab-out-of-bounds in pfkey_add+0x153e/0x3470 net/key/af_key.c:1498 Read of size 8192 at addr ffff8801ccd58a18 by task syzkaller248753/3324 CPU: 0 PID: 3324 Comm: syzkaller248753 Not tainted 4.9.74-g4406671 #13 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801c9857718 ffffffff81d91d19 ffffea0007335600 ffff8801ccd58a18 0000000000000000 ffff8801ccd58c00 ffff8801c9857958 ffff8801c9857750 ffffffff8153b503 ffff8801ccd58a18 0000000000002000 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x73/0x280 mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report+0x275/0x360 mm/kasan/report.c:408 [] check_memory_region_inline mm/kasan/kasan.c:318 [inline] [] check_memory_region+0x137/0x190 mm/kasan/kasan.c:325 [] memcpy+0x23/0x50 mm/kasan/kasan.c:360 [] pfkey_msg2xfrm_state net/key/af_key.c:1219 [inline] [] pfkey_add+0x153e/0x3470 net/key/af_key.c:1498 [] pfkey_process+0x61e/0x730 net/key/af_key.c:2826 [] pfkey_sendmsg+0x3a9/0x760 net/key/af_key.c:3670 [] sock_sendmsg_nosec net/socket.c:635 [inline] [] sock_sendmsg+0xca/0x110 net/socket.c:645 [] ___sys_sendmsg+0x6d1/0x7e0 net/socket.c:1969 [] __sys_sendmsg+0xd6/0x190 net/socket.c:2003 [] C_SYSC_sendmsg net/compat.c:734 [inline] [] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:732 [] do_syscall_32_irqs_on arch/x86/entry/common.c:322 [inline] [] do_fast_syscall_32+0x2f7/0x890 arch/x86/entry/common.c:384 [] entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:124 Allocated by task 3324: 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+0xad/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+0xda/0x2b0 mm/slub.c:4232 __kmalloc_reserve.isra.37+0x33/0xc0 net/core/skbuff.c:138 __alloc_skb+0x119/0x600 net/core/skbuff.c:231 alloc_skb include/linux/skbuff.h:919 [inline] pfkey_sendmsg+0x135/0x760 net/key/af_key.c:3657 sock_sendmsg_nosec net/socket.c:635 [inline] sock_sendmsg+0xca/0x110 net/socket.c:645 ___sys_sendmsg+0x6d1/0x7e0 net/socket.c:1969 __sys_sendmsg+0xd6/0x190 net/socket.c:2003 C_SYSC_sendmsg net/compat.c:734 [inline] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:732 do_syscall_32_irqs_on arch/x86/entry/common.c:322 [inline] do_fast_syscall_32+0x2f7/0x890 arch/x86/entry/common.c:384 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:124 Freed by task 1763: 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+0x103/0x300 mm/slub.c:3878 skb_free_head+0x74/0xb0 net/core/skbuff.c:580 skb_release_data+0x315/0x3f0 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 skb_free_datagram+0x1a/0xe0 net/core/datagram.c:299 netlink_recvmsg+0x60b/0xe10 net/netlink/af_netlink.c:1926 sock_recvmsg_nosec net/socket.c:737 [inline] sock_recvmsg+0xc9/0x110 net/socket.c:744 ___sys_recvmsg+0x24c/0x530 net/socket.c:2128 __sys_recvmsg+0xd3/0x190 net/socket.c:2173 SYSC_recvmsg net/socket.c:2185 [inline] SyS_recvmsg+0x2d/0x50 net/socket.c:2180 entry_SYSCALL_64_fastpath+0x23/0xc6 The buggy address belongs to the object at ffff8801ccd58a00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of 512-byte region [ffff8801ccd58a00, ffff8801ccd58c00) The buggy address belongs to the page: page:ffffea0007335600 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: ffff8801ccd58b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801ccd58b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8801ccd58c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8801ccd58c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ccd58d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================