================================================================== 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 4096 at addr ffff8800b3d50298 by task syz-executor6/5591 CPU: 0 PID: 5591 Comm: syz-executor6 Not tainted 4.4.133-g3f51ea2 #51 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 2224e2438f70eed6 ffff8800aba07740 ffffffff81e0e4cd ffffea0002cf5400 ffff8800b3d50298 0000000000000000 ffff8800b3d50480 ffff8800b3d50280 ffff8800aba07778 ffffffff815154cc ffff8800b3d50298 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 [] SYSC_sendmsg net/socket.c:2007 [inline] [] SyS_sendmsg+0x2d/0x50 net/socket.c:2003 [] entry_SYSCALL_64_fastpath+0x22/0x9e SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket Allocated by task 5591: [] 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 4112: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket [] 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 [] tcp_v4_rcv+0x5f/0x3010 net/ipv4/tcp_ipv4.c:1705 [] ip_local_deliver_finish+0x257/0xa60 net/ipv4/ip_input.c:216 [] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline] [] NF_HOOK include/linux/netfilter.h:249 [inline] [] ip_local_deliver+0x1f1/0x380 net/ipv4/ip_input.c:257 [] dst_input include/net/dst.h:504 [inline] [] ip_rcv_finish+0x65a/0x1640 net/ipv4/ip_input.c:365 [] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline] [] NF_HOOK include/linux/netfilter.h:249 [inline] [] ip_rcv+0x9e4/0x1190 net/ipv4/ip_input.c:455 [] __netif_receive_skb_core+0x12d6/0x2940 net/core/dev.c:4019 [] __netif_receive_skb+0x5b/0x1b0 net/core/dev.c:4054 [] process_backlog+0x216/0x6a0 net/core/dev.c:4647 [] napi_poll net/core/dev.c:4885 [inline] [] net_rx_action+0x3a2/0xdb0 net/core/dev.c:4950 [] __do_softirq+0x22c/0xa1a kernel/softirq.c:273 The buggy address belongs to the object at ffff8800b3d50280 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of 512-byte region [ffff8800b3d50280, ffff8800b3d50480) 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: 5627 Comm: modprobe Not tainted 4.4.133-g3f51ea2 #51 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801d1efe000 task.stack: ffff8801cfce8000 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: 00010086 RAX: 5028454741505f4e RBX: dffffc0000000000 RCX: ffff8800ab99fe08 RDX: ffffed003b6632e2 RSI: ffff8801db319710 RDI: 0a0508a8e82a0be9 RBP: ffff8801db307d40 R08: ffffffff8533dfd0 R09: 0000000000000001 R10: 0000000000000000 R11: ffff8801d1efe000 R12: ffff8800ab99fdf8 R13: ffff8800ab99fdf9 R14: ffffffff83aa9be8 R15: ffffffff83aa9be0 FS: 0000000000000000(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffdb874fcc4 CR3: 00000001d7f9f000 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffffffff844c64e0 ffff8801d1efe000 ffffed003a3dfd1b ffff8801d1efe8e0 ffff8801bb657df8 ffff8801db319710 ffff8801db319718 0000000000000000 0000000000000000 ffff8801db307d70 ffffffff81e2c0e8 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 [] selinux_inode_permission+0x269/0x480 security/selinux/hooks.c:2902 [] security_inode_permission+0xb9/0x100 security/security.c:600 [] __inode_permission2+0x93/0x240 fs/namei.c:425 [] inode_permission2+0x2f/0x110 fs/namei.c:475 [] may_lookup fs/namei.c:1665 [inline] [] link_path_walk+0x18c/0x1710 fs/namei.c:1929 [] path_openat+0x1a4/0x3a10 fs/namei.c:3358 [] do_filp_open+0x197/0x270 fs/namei.c:3393 [] do_sys_open+0x31c/0x610 fs/open.c:1038 [] SYSC_open fs/open.c:1056 [inline] [] SyS_open+0x2d/0x40 fs/open.c:1051 [] entry_SYSCALL_64_fastpath+0x22/0x9e 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 dac2fadee2d9930f ]---