================================================================== BUG: KASAN: slab-out-of-bounds in pfkey_msg2xfrm_state net/key/af_key.c:1188 [inline] BUG: KASAN: slab-out-of-bounds in pfkey_add+0x2537/0x3220 net/key/af_key.c:1506 Read of size 4898 at addr ffff8801abf6cf18 by task syz-executor1/15991 CPU: 0 PID: 15991 Comm: syz-executor1 Not tainted 4.4.135-ge75204c #53 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 231bebb4592e8733 ffff8801baf9f6c0 ffffffff81e0ed0d ffffea0006afdb00 ffff8801abf6cf18 0000000000000000 ffff8801abf6d100 ffff8801abf6cf00 ffff8801baf9f6f8 ffffffff81515946 ffff8801abf6cf18 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:1188 [inline] [] pfkey_add+0x2537/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: 8 bytes leftover after parsing attributes in process `syz-executor7'. [] __sys_sendmsg+0xd6/0x190 net/socket.c:1996 [] C_SYSC_sendmsg net/compat.c:722 [inline] [] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:720 [] 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 15991: [] 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:722 [inline] [] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:720 [] 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 0: (stack is not available) The buggy address belongs to the object at ffff8801abf6cf00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of 512-byte region [ffff8801abf6cf00, ffff8801abf6d100) The buggy address belongs to the page: kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.135-ge75204c #53 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801d9a41800 task.stack: ffff8801d9a50000 RIP: 0010:[] [] rb_set_parent_color include/linux/rbtree_augmented.h:117 [inline] RIP: 0010:[] [] ____rb_erase_color lib/rbtree.c:345 [inline] RIP: 0010:[] [] rb_erase+0x721/0x1cb0 lib/rbtree.c:429 RSP: 0018:ffff8801db307cf8 EFLAGS: 00010082 RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffff8801baa17d38 RDX: ffffed003b6632e2 RSI: ffff8801db319710 RDI: 0000000000000000 RBP: ffff8801db307d40 R08: ffffffff8533dfd0 R09: 0000000000000001 R10: 0000000000000000 R11: ffff8801d9a41800 R12: ffff8801baa17d28 R13: ffff8801baa17d29 R14: ffffea0006afdb08 R15: ffffea0006afdb00 FS: 0000000000000000(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000f57a6db0 CR3: 00000001d8403000 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffffffff844c6720 ffff8801d9a41800 ffffed003b34841b ffff8801d9a420e0 ffff8801d437fd28 ffff8801db319710 ffff8801db319718 0000000000000000 0000000000000000 ffff8801db307d70 ffffffff81e2c928 ffffffff844bdba0 Call Trace: [] timerqueue_del+0x78/0x170 lib/timerqueue.c:86 [] __remove_hrtimer+0x8e/0x250 kernel/time/hrtimer.c:917 [] __run_hrtimer kernel/time/hrtimer.c:1242 [inline] [] __hrtimer_run_queues+0x2dd/0x1000 kernel/time/hrtimer.c:1325 [] hrtimer_interrupt+0x1b1/0x430 kernel/time/hrtimer.c:1359 [] local_apic_timer_interrupt+0x74/0xa0 arch/x86/kernel/apic/apic.c:901 [] smp_apic_timer_interrupt+0x7c/0xa0 arch/x86/kernel/apic/apic.c:925 [] apic_timer_interrupt+0xa0/0xb0 arch/x86/entry/entry_64.S:741 [] arch_safe_halt arch/x86/include/asm/paravirt.h:117 [inline] [] default_idle+0x55/0x3c0 arch/x86/kernel/process.c:290 [] arch_cpu_idle+0x10/0x20 arch/x86/kernel/process.c:281 [] default_idle_call+0x57/0x70 kernel/sched/idle.c:93 [] cpuidle_idle_call kernel/sched/idle.c:157 [inline] [] cpu_idle_loop kernel/sched/idle.c:253 [inline] [] cpu_startup_entry+0x6af/0x780 kernel/sched/idle.c:301 [] start_secondary+0x324/0x400 arch/x86/kernel/smpboot.c:242 Code: 15 00 00 4c 89 f7 49 89 44 24 10 48 c1 ef 03 80 3c 1f 00 0f 85 fd 14 00 00 48 89 c7 4d 89 e5 4d 89 67 08 48 c1 ef 03 49 83 cd 01 <80> 3c 1f 00 0f 85 95 0f 00 00 4c 89 e7 4c 89 28 48 c1 ef 03 80 RIP [] rb_set_parent_color include/linux/rbtree_augmented.h:117 [inline] RIP [] ____rb_erase_color lib/rbtree.c:345 [inline] RIP [] rb_erase+0x721/0x1cb0 lib/rbtree.c:429 RSP ---[ end trace 2f5e7673547d0af2 ]---