================================================================== 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+0x145d/0x3220 net/key/af_key.c:1506 Read of size 2048 at addr ffff8801d233e298 by task syz-executor2/23165 CPU: 1 PID: 23165 Comm: syz-executor2 Not tainted 4.4.132-g4b08356 #48 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 c1b46a19e2181efe ffff88009e7676c0 ffffffff81e0dfed ffffea000748cf80 ffff8801d233e298 0000000000000000 ffff8801d233e480 ffff8801d233e280 ffff88009e7676f8 ffffffff8151527c ffff8801d233e298 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] print_address_description+0x6c/0x216 mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report.cold.7+0x175/0x2f7 mm/kasan/report.c:408 [] check_memory_region_inline mm/kasan/kasan.c:325 [inline] [] check_memory_region+0x14f/0x1b0 mm/kasan/kasan.c:332 [] memcpy+0x23/0x50 mm/kasan/kasan.c:367 [] pfkey_msg2xfrm_state net/key/af_key.c:1227 [inline] [] pfkey_add+0x145d/0x3220 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:625 [inline] [] sock_sendmsg+0xcc/0x110 net/socket.c:635 [] ___sys_sendmsg+0x745/0x880 net/socket.c:1962 [] __sys_sendmsg+0xd6/0x190 net/socket.c:1996 [] C_SYSC_sendmsg net/compat.c:720 [inline] [] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:718 [] do_syscall_32_irqs_on arch/x86/entry/common.c:392 [inline] [] do_fast_syscall_32+0x326/0x8b0 arch/x86/entry/common.c:459 [] sysenter_flags_fixed+0xd/0x17 Allocated by task 23165: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack+0x43/0xd0 mm/kasan/kasan.c:512 [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:616 [] kasan_krealloc+0x64/0x80 mm/kasan/kasan.c:654 [] ksize+0x8a/0xf0 mm/slub.c:3727 [] __alloc_skb+0x133/0x600 net/core/skbuff.c:237 [] alloc_skb include/linux/skbuff.h:815 [inline] [] pfkey_sendmsg+0xfe/0xae0 net/key/af_key.c:3665 [] sock_sendmsg_nosec net/socket.c:625 [inline] [] sock_sendmsg+0xcc/0x110 net/socket.c:635 [] ___sys_sendmsg+0x745/0x880 net/socket.c:1962 [] __sys_sendmsg+0xd6/0x190 net/socket.c:1996 [] C_SYSC_sendmsg net/compat.c:720 [inline] [] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:718 [] do_syscall_32_irqs_on arch/x86/entry/common.c:392 [inline] [] do_fast_syscall_32+0x326/0x8b0 arch/x86/entry/common.c:459 [] sysenter_flags_fixed+0xd/0x17 Freed by task 20752: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack+0x43/0xd0 mm/kasan/kasan.c:512 [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:589 [] slab_free_hook mm/slub.c:1383 [inline] [] slab_free_freelist_hook mm/slub.c:1405 [inline] [] slab_free mm/slub.c:2859 [inline] [] kfree+0xf4/0x310 mm/slub.c:3749 [] skb_free_head net/core/skbuff.c:571 [inline] [] skb_release_data+0x304/0x3b0 net/core/skbuff.c:602 [] skb_release_all+0x4a/0x60 net/core/skbuff.c:661 [] __kfree_skb+0x15/0x20 net/core/skbuff.c:675 [] kfree_skb+0xf7/0x3e0 net/core/skbuff.c:696 [] __neigh_event_send+0x652/0xc50 net/core/neighbour.c:1016 [] neigh_event_send include/net/neighbour.h:431 [inline] [] neigh_resolve_output+0x4eb/0x790 net/core/neighbour.c:1310 [] dst_neigh_output include/net/dst.h:461 [inline] [] ip6_finish_output2+0x929/0x1ca0 net/ipv6/ip6_output.c:113 [] ip6_finish_output+0x3b8/0x760 net/ipv6/ip6_output.c:131 [] NF_HOOK_COND include/linux/netfilter.h:240 [inline] [] ip6_output+0x1b8/0x520 net/ipv6/ip6_output.c:145 [] dst_output include/net/dst.h:498 [inline] [] ip6_local_out+0x9b/0x180 net/ipv6/output_core.c:169 [] ip6_send_skb+0xa1/0x340 net/ipv6/ip6_output.c:1724 [] udp_v6_send_skb+0x4f1/0xe70 net/ipv6/udp.c:1066 [] udpv6_sendmsg+0x1f2e/0x24c0 net/ipv6/udp.c:1330 [] inet_sendmsg+0x203/0x4d0 net/ipv4/af_inet.c:755 [] sock_sendmsg_nosec net/socket.c:625 [inline] [] sock_sendmsg+0xcc/0x110 net/socket.c:635 [] ___sys_sendmsg+0x441/0x880 net/socket.c:1962 [] __sys_sendmmsg+0x1d4/0x2e0 net/socket.c:2040 [] C_SYSC_sendmmsg net/compat.c:726 [inline] [] compat_SyS_sendmmsg+0x32/0x40 net/compat.c:723 [] do_syscall_32_irqs_on arch/x86/entry/common.c:392 [inline] [] do_fast_syscall_32+0x326/0x8b0 arch/x86/entry/common.c:459 [] sysenter_flags_fixed+0xd/0x17 The buggy address belongs to the object at ffff8801d233e280 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of 512-byte region [ffff8801d233e280, ffff8801d233e480) The buggy address belongs to the page: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 23189 at kernel/locking/lockdep.c:973 lock_accessed kernel/locking/lockdep.c:973 [inline]() WARNING: CPU: 0 PID: 23189 at kernel/locking/lockdep.c:973 __bfs+0x2aa/0x5f0 kernel/locking/lockdep.c:1040()