netlink: 4 bytes leftover after parsing attributes in process `syz-executor3'. ================================================================== 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 5251 at addr ffff8801d7341698 by task syz-executor5/10549 CPU: 1 PID: 10549 Comm: syz-executor5 Not tainted 4.4.135-g6cdd987d #56 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 fd23a9d8146ae027 ffff8801b7727740 ffffffff81e0ed0d ffffea00075cd000 ffff8801d7341698 0000000000000000 ffff8801d7341880 ffff8801d7341680 ffff8801b7727778 ffffffff81515946 ffff8801d7341698 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 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. [] 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 [] SYSC_sendmsg net/socket.c:2007 [inline] [] SyS_sendmsg+0x2d/0x50 net/socket.c:2003 [] entry_SYSCALL_64_fastpath+0x22/0x9e Allocated by task 10549: [] 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 9375: [] 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+0x1fb7/0x4c20 fs/binfmt_elf.c:1078 [] 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+0x3a/0x50 fs/exec.c:1679 [] call_usermodehelper_exec_async+0x296/0x4d0 kernel/kmod.c:252 [] ret_from_fork+0x55/0x80 arch/x86/entry/entry_64.S:510 The buggy address belongs to the object at ffff8801d7341680 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of 512-byte region [ffff8801d7341680, ffff8801d7341880) The buggy address belongs to the page: -------[ 144.635583] BUG: unable to handle kernel NULL pointer dereference at 0000000000000062 IP: [] str__compaction__trace_system_name+0x56b/0xfa0 PGD 0 Thread overran stack, or stack corrupted Oops: 0002 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 10565 Comm: modprobe Not tainted 4.4.135-g6cdd987d #56 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801b7761800 task.stack: ffff8801b5ca0000 RIP: 0010:[] [] str__compaction__trace_system_name+0x56b/0xfa0 RSP: 0018:ffff8801b5ca7710 EFLAGS: 00010002 RAX: 0000000000000000 RBX: ffffffff862aa4c0 RCX: 0000000000000000 RDX: 00000000000003fd RSI: ffffffff82083ee1 RDI: ffff8801d7341680 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: ffffffff858ed132 R12: ffffea00075cd000 R13: 0000000000000020 R14: fffffbfff0c554df R15: 0000000000000000 FS: 00007fc884788700(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000062 CR3: 00000001d9488000 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: 0000000000000000 ffff8801d7341880 ffff8801b5ca7760 ffffffff8148cf07 000000000000002d ffffea00075cd000 0000000000000000 ffffffff83aa9ee0 ffff8801d7341680 ffff8801d7341880 ffff8801b5ca77a0 ffffffff8148cf07 Call Trace: Code: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 4d 5f 42 55 47 5f 4f 4e 5f 50 <41> 47 45 28 50 61 67 65 53 6c 61 62 28 70 61 67 65 29 29 00 00 RIP [] str__compaction__trace_system_name+0x56b/0xfa0 RSP CR2: 0000000000000062 ---[ end trace 302ceebf7245877e ]---