================================================================== 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 7744 at addr ffff8801cd0451c0 by task syz-executor3/6651 CPU: 1 PID: 6651 Comm: syz-executor3 Not tainted 4.4.137-ga2e2217 #61 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=8245 sclass=netlink_route_socket 0000000000000000 0c2585e2afb2c5f6 ffff8801b8537740 ffffffff81e0ee0d ffffea0007341100 ffff8801cd0451c0 0000000000000000 ffff8801cd045380 ffff8801cd045180 ffff8801b8537778 ffffffff81515a16 ffff8801cd0451c0 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 netlink: 212 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 212 bytes leftover after parsing attributes in process `syz-executor7'. [] __sys_sendmsg+0xd6/0x190 net/socket.c:1996 [] SYSC_sendmsg net/socket.c:2007 [inline] [] SyS_sendmsg+0x2d/0x50 net/socket.c:2003 [] entry_SYSCALL_64_fastpath+0x22/0x9e Allocated by task 6651: [] 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 [] SYSC_sendmsg net/socket.c:2007 [inline] [] SyS_sendmsg+0x2d/0x50 net/socket.c:2003 [] entry_SYSCALL_64_fastpath+0x22/0x9e Freed by task 4670: [] 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 [] load_elf_binary+0x1fc3/0x4c20 fs/binfmt_elf.c:1079 [] search_binary_handler+0x14f/0x6f0 fs/exec.c:1471 [] exec_binprm fs/exec.c:1513 [inline] [] do_execveat_common.isra.36+0x116d/0x1f10 fs/exec.c:1635 [] do_execve fs/exec.c:1679 [inline] [] SYSC_execve fs/exec.c:1760 [inline] [] SyS_execve+0x42/0x50 fs/exec.c:1755 [] return_from_execve+0x0/0x23 The buggy address belongs to the object at ffff8801cd045180 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 64 bytes inside of 512-byte region [ffff8801cd045180, ffff8801cd045380) The buggy address belongs to the page: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 6655 at kernel/locking/lockdep.c:973 lock_accessed kernel/locking/lockdep.c:973 [inline]() WARNING: CPU: 0 PID: 6655 at kernel/locking/lockdep.c:973 __bfs+0x2aa/0x5f0 kernel/locking/lockdep.c:1040()