================================================================== 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 6784 at addr ffff8800b9575418 by task syz-executor0/6537 CPU: 0 PID: 6537 Comm: syz-executor0 Not tainted 4.4.135-gb68f27c #52 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 863ef57e58b99e3a ffff8800957176c0 ffffffff81e0ed0d ffffea0002e55d00 ffff8800b9575418 0000000000000000 ffff8800b9575600 ffff8800b9575400 ffff8800957176f8 ffffffff81515946 ffff8800b9575418 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 [] __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 6537: [] 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 4502: [] 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 [] unix_release_sock+0x4b5/0xa00 net/unix/af_unix.c:559 [] unix_release+0x44/0x90 net/unix/af_unix.c:835 [] sock_release+0x96/0x1c0 net/socket.c:586 [] sock_close+0x16/0x20 net/socket.c:1037 [] __fput+0x235/0x6f0 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x10f/0x190 kernel/task_work.c:115 [] tracehook_notify_resume include/linux/tracehook.h:191 [inline] [] exit_to_usermode_loop+0x13d/0x160 arch/x86/entry/common.c:252 [] prepare_exit_to_usermode arch/x86/entry/common.c:283 [inline] [] syscall_return_slowpath arch/x86/entry/common.c:348 [inline] [] do_syscall_32_irqs_on arch/x86/entry/common.c:398 [inline] [] do_fast_syscall_32+0x620/0x8b0 arch/x86/entry/common.c:459 [] sysenter_flags_fixed+0xd/0x17 The buggy address belongs to the object at ffff8800b9575400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of 512-byte region [ffff8800b9575400, ffff8800b9575600) 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: 3908 Comm: syz-executor0 Not tainted 4.4.135-gb68f27c #52 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801d8766000 task.stack: ffff8800ab240000 RIP: 0010:[] [] __debug_check_no_obj_freed lib/debugobjects.c:689 [inline] RIP: 0010:[] [] debug_check_no_obj_freed+0x1a6/0x940 lib/debugobjects.c:726 RSP: 0018:ffff8800ab247840 EFLAGS: 00010007 RAX: 0000000000000296 RBX: 4f5f4755425f4d56 RCX: ffffffff81e71d3e RDX: 09ebe8eaa84be9aa RSI: 0000000000000003 RDI: ffffffff83aa9ef8 RBP: ffff8800ab247928 R08: ffff8800ab2478c0 R09: dead000000000200 R10: 0000000000000001 R11: ffff8801d8766000 R12: 4f5f4755425f4d56 R13: dffffc0000000000 R14: ffffffff85a49768 R15: 0000292965676170 FS: 0000000000000000(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 000000008148cf07 CR3: 000000000440c000 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffff8801d8766900 ffff8800ab2478c0 ffffffff85a49760 ffff8801c5f5d000 ffff8801c5f5d000 ffffffff00000003 0000000000000296 00000000000b6f80 1ffff10015648f14 ffff8801c5f5c000 fffffbfff0b492ec ffff8801c5f5c000 Call Trace: [] free_pages_prepare+0x51e/0xad0 mm/page_alloc.c:1049 [] free_hot_cold_page+0x3f/0x3a0 mm/page_alloc.c:2112 [] free_hot_cold_page_list+0x98/0x3c0 mm/page_alloc.c:2160 [] release_pages+0x1f7/0x4f0 mm/swap.c:970 [] free_pages_and_swap_cache+0x106/0x140 mm/swap_state.c:266 [] tlb_flush_mmu_free+0xb4/0x150 mm/memory.c:255 [] tlb_flush_mmu mm/memory.c:264 [inline] [] tlb_finish_mmu+0x29/0xd0 mm/memory.c:275 [] exit_mmap+0x1e9/0x3a0 mm/mmap.c:2929 [] __mmput kernel/fork.c:715 [inline] [] mmput+0xf8/0x2d0 kernel/fork.c:735 [] exit_mm kernel/exit.c:444 [inline] [] do_exit+0x8d8/0x26b0 kernel/exit.c:746 [] do_group_exit+0x111/0x330 kernel/exit.c:889 [] SYSC_exit_group kernel/exit.c:900 [inline] [] SyS_exit_group+0x1d/0x20 kernel/exit.c:898 [] 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 Code: 48 c7 c6 e0 27 99 85 4c 8b 24 3e 4d 85 e4 0f 84 f8 03 00 00 49 b9 00 02 00 00 00 00 ad de 31 f6 4c 8d 45 98 4c 89 e2 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 e5 03 00 00 49 8d 7c 24 18 83 c6 01 49 8b RIP [] __debug_check_no_obj_freed lib/debugobjects.c:689 [inline] RIP [] debug_check_no_obj_freed+0x1a6/0x940 lib/debugobjects.c:726 RSP ---[ end trace 88e8f3ecf227eece ]---