================================================================== BUG: KASAN: use-after-free in __skb_unlink include/linux/skbuff.h:1753 [inline] at addr ffff8801cac25508 BUG: KASAN: use-after-free in __skb_dequeue include/linux/skbuff.h:1770 [inline] at addr ffff8801cac25508 BUG: KASAN: use-after-free in skb_dequeue+0x162/0x180 net/core/skbuff.c:2381 at addr ffff8801cac25508 Write of size 8 by task syz-executor0/3353 CPU: 1 PID: 3353 Comm: syz-executor0 Not tainted 4.9.39-g72a0c9f #6 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801cfa776c8 ffffffff81eacd59 ffff8801d9ff23c0 ffff8801cac25500 ffff8801cac255e0 ffffed0039584aa1 ffff8801cac25508 ffff8801cfa776f0 ffffffff81546bfc ffffed0039584aa1 ffff8801d9ff23c0 0000000000000001 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] kasan_object_err+0x1c/0x70 mm/kasan/report.c:160 [] print_address_description mm/kasan/report.c:198 [inline] [] kasan_report_error mm/kasan/report.c:287 [inline] [] kasan_report.part.1+0x20d/0x4e0 mm/kasan/report.c:309 [] kasan_report mm/kasan/report.c:335 [inline] [] __asan_report_store8_noabort+0x2c/0x30 mm/kasan/report.c:335 [] __skb_unlink include/linux/skbuff.h:1753 [inline] [] __skb_dequeue include/linux/skbuff.h:1770 [inline] [] skb_dequeue+0x162/0x180 net/core/skbuff.c:2381 [] skb_queue_purge+0x26/0x40 net/core/skbuff.c:2418 [] pfkey_sock_destruct+0x157/0x370 net/key/af_key.c:103 [] __sk_destruct+0x53/0x570 net/core/sock.c:1428 [] sk_destruct+0x47/0x80 net/core/sock.c:1463 [] __sk_free+0x57/0x230 net/core/sock.c:1471 [] sk_free+0x23/0x30 net/core/sock.c:1482 [] sock_put include/net/sock.h:1592 [inline] [] pfkey_release+0x25e/0x2f0 net/key/af_key.c:189 [] sock_release+0x8d/0x1e0 net/socket.c:599 [] sock_close+0x16/0x20 net/socket.c:1046 [] __fput+0x28c/0x6e0 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x115/0x190 kernel/task_work.c:116 [] exit_task_work include/linux/task_work.h:21 [inline] [] do_exit+0x82e/0x2a50 kernel/exit.c:833 [] do_group_exit+0x108/0x320 kernel/exit.c:937 [] get_signal+0x55c/0x1600 kernel/signal.c:2315 [] do_signal+0x7f/0x1940 arch/x86/kernel/signal.c:807 [] exit_to_usermode_loop+0xe5/0x130 arch/x86/entry/common.c:156 [] prepare_exit_to_usermode arch/x86/entry/common.c:190 [inline] [] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259 [] entry_SYSCALL_64_fastpath+0xc4/0xc6 Object at ffff8801cac25500, in cache skbuff_head_cache size: 224 Allocated: PID = 3351 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:598 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:537 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] kmem_cache_alloc_node+0x107/0x2a0 mm/slub.c:2751 __alloc_skb+0xef/0x600 net/core/skbuff.c:219 alloc_skb include/linux/skbuff.h:919 [inline] pfkey_xfrm_policy2msg_prep+0x29/0x50 net/key/af_key.c:2010 dump_sp+0xa8/0x450 net/key/af_key.c:2655 xfrm_policy_walk+0x1b1/0x4d0 net/xfrm/xfrm_policy.c:1047 pfkey_dump_sp+0x42/0x50 net/key/af_key.c:2682 pfkey_do_dump+0x40/0x2b0 net/key/af_key.c:288 pfkey_spddump+0x187/0x1e0 net/key/af_key.c:2705 pfkey_process+0x606/0x710 net/key/af_key.c:2795 pfkey_sendmsg+0x3af/0x750 net/key/af_key.c:3636 sock_sendmsg_nosec net/socket.c:635 [inline] sock_sendmsg+0xca/0x110 net/socket.c:645 sock_write_iter+0x21d/0x3a0 net/socket.c:843 new_sync_write fs/read_write.c:499 [inline] __vfs_write+0x4ac/0x660 fs/read_write.c:512 vfs_write+0x170/0x4e0 fs/read_write.c:560 SYSC_write fs/read_write.c:607 [inline] SyS_write+0xd4/0x1a0 fs/read_write.c:599 entry_SYSCALL_64_fastpath+0x23/0xc6 Freed: PID = 3352 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:571 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kmem_cache_free+0xb2/0x2e0 mm/slub.c:2980 kfree_skbmem+0xd7/0xf0 net/core/skbuff.c:623 __kfree_skb+0x1d/0x20 net/core/skbuff.c:685 kfree_skb+0xcc/0x330 net/core/skbuff.c:705 pfkey_broadcast+0x3d6/0x5f0 net/key/af_key.c:279 pfkey_do_dump+0x20e/0x2b0 net/key/af_key.c:299 pfkey_recvmsg+0x443/0x4f0 net/key/af_key.c:3680 sock_recvmsg_nosec net/socket.c:737 [inline] sock_recvmsg+0xc9/0x110 net/socket.c:744 SYSC_recvfrom+0x1e3/0x300 net/socket.c:1721 SyS_recvfrom+0x40/0x50 net/socket.c:1694 entry_SYSCALL_64_fastpath+0x23/0xc6 Memory state around the buggy address: ffff8801cac25400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801cac25480: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801cac25500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801cac25580: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff8801cac25600: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ================================================================== ================================================================== BUG: KASAN: use-after-free in __skb_unlink include/linux/skbuff.h:1750 [inline] at addr ffff8801cac25500 BUG: KASAN: use-after-free in __skb_dequeue include/linux/skbuff.h:1770 [inline] at addr ffff8801cac25500 BUG: KASAN: use-after-free in skb_dequeue+0x176/0x180 net/core/skbuff.c:2381 at addr ffff8801cac25500 Read of size 8 by task syz-executor0/3353 CPU: 1 PID: 3353 Comm: syz-executor0 Tainted: G B 4.9.39-g72a0c9f #6 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801cfa776c8 ffffffff81eacd59 ffff8801d9ff23c0 ffff8801cac25500 ffff8801cac255e0 ffffed0039584aa0 ffff8801cac25500 ffff8801cfa776f0 ffffffff81546bfc ffffed0039584aa0 ffff8801d9ff23c0 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] kasan_object_err+0x1c/0x70 mm/kasan/report.c:160 [] print_address_description mm/kasan/report.c:198 [inline] [] kasan_report_error mm/kasan/report.c:287 [inline] [] kasan_report.part.1+0x20d/0x4e0 mm/kasan/report.c:309 [] kasan_report mm/kasan/report.c:330 [inline] [] __asan_report_load8_noabort+0x29/0x30 mm/kasan/report.c:330 [] __skb_unlink include/linux/skbuff.h:1750 [inline] [] __skb_dequeue include/linux/skbuff.h:1770 [inline] [] skb_dequeue+0x176/0x180 net/core/skbuff.c:2381 [] skb_queue_purge+0x26/0x40 net/core/skbuff.c:2418 [] pfkey_sock_destruct+0x157/0x370 net/key/af_key.c:103 [] __sk_destruct+0x53/0x570 net/core/sock.c:1428 [] sk_destruct+0x47/0x80 net/core/sock.c:1463 [] __sk_free+0x57/0x230 net/core/sock.c:1471 [] sk_free+0x23/0x30 net/core/sock.c:1482 [] sock_put include/net/sock.h:1592 [inline] [] pfkey_release+0x25e/0x2f0 net/key/af_key.c:189 [] sock_release+0x8d/0x1e0 net/socket.c:599 [] sock_close+0x16/0x20 net/socket.c:1046 [] __fput+0x28c/0x6e0 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x115/0x190 kernel/task_work.c:116 [] exit_task_work include/linux/task_work.h:21 [inline] [] do_exit+0x82e/0x2a50 kernel/exit.c:833 [] do_group_exit+0x108/0x320 kernel/exit.c:937 [] get_signal+0x55c/0x1600 kernel/signal.c:2315 [] do_signal+0x7f/0x1940 arch/x86/kernel/signal.c:807 [] exit_to_usermode_loop+0xe5/0x130 arch/x86/entry/common.c:156 [] prepare_exit_to_usermode arch/x86/entry/common.c:190 [inline] [] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259 [] entry_SYSCALL_64_fastpath+0xc4/0xc6 Object at ffff8801cac25500, in cache skbuff_head_cache size: 224 Allocated: PID = 3351 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:598 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:537 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] kmem_cache_alloc_node+0x107/0x2a0 mm/slub.c:2751 __alloc_skb+0xef/0x600 net/core/skbuff.c:219 alloc_skb include/linux/skbuff.h:919 [inline] pfkey_xfrm_policy2msg_prep+0x29/0x50 net/key/af_key.c:2010 dump_sp+0xa8/0x450 net/key/af_key.c:2655 xfrm_policy_walk+0x1b1/0x4d0 net/xfrm/xfrm_policy.c:1047 pfkey_dump_sp+0x42/0x50 net/key/af_key.c:2682 pfkey_do_dump+0x40/0x2b0 net/key/af_key.c:288 pfkey_spddump+0x187/0x1e0 net/key/af_key.c:2705 pfkey_process+0x606/0x710 net/key/af_key.c:2795 pfkey_sendmsg+0x3af/0x750 net/key/af_key.c:3636 sock_sendmsg_nosec net/socket.c:635 [inline] sock_sendmsg+0xca/0x110 net/socket.c:645 sock_write_iter+0x21d/0x3a0 net/socket.c:843 new_sync_write fs/read_write.c:499 [inline] __vfs_write+0x4ac/0x660 fs/read_write.c:512 vfs_write+0x170/0x4e0 fs/read_write.c:560 SYSC_write fs/read_write.c:607 [inline] SyS_write+0xd4/0x1a0 fs/read_write.c:599 entry_SYSCALL_64_fastpath+0x23/0xc6 Freed: PID = 3352 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:571 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kmem_cache_free+0xb2/0x2e0 mm/slub.c:2980 kfree_skbmem+0xd7/0xf0 net/core/skbuff.c:623 __kfree_skb+0x1d/0x20 net/core/skbuff.c:685 kfree_skb+0xcc/0x330 net/core/skbuff.c:705 pfkey_broadcast+0x3d6/0x5f0 net/key/af_key.c:279 pfkey_do_dump+0x20e/0x2b0 net/key/af_key.c:299 pfkey_recvmsg+0x443/0x4f0 net/key/af_key.c:3680 sock_recvmsg_nosec net/socket.c:737 [inline] sock_recvmsg+0xc9/0x110 net/socket.c:744 SYSC_recvfrom+0x1e3/0x300 net/socket.c:1721 SyS_recvfrom+0x40/0x50 net/socket.c:1694 entry_SYSCALL_64_fastpath+0x23/0xc6 Memory state around the buggy address: ffff8801cac25400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb