syzbot


KASAN: use-after-free Read in xfrm6_tunnel_destroy

Status: upstream: reported C repro on 2019/04/12 04:12
Reported-by: syzbot+74900e5257bb7d5c7cc3@syzkaller.appspotmail.com
First crash: 2050d, last: 1023d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-44 KASAN: use-after-free Read in xfrm6_tunnel_destroy (2) 1 1899d 1899d 0/2 auto-closed as invalid on 2020/01/08 12:52
android-414 KASAN: use-after-free Read in xfrm6_tunnel_destroy C 34461 1814d 2052d 0/1 public: reported C repro on 2019/04/10 15:44
android-44 KASAN: use-after-free Read in xfrm6_tunnel_destroy 4 2149d 2048d 0/2 auto-closed as invalid on 2019/07/02 12:36
android-49 KASAN: use-after-free Read in xfrm6_tunnel_destroy C 36181 1814d 2050d 0/3 public: reported C repro on 2019/04/12 00:00
Last patch testing requests (10)
Created Duration User Patch Repo Result
2023/02/11 09:32 9m retest repro linux-4.14.y report log
2023/02/11 08:32 14m retest repro linux-4.14.y report log
2023/02/11 07:32 9m retest repro linux-4.14.y report log
2023/02/11 06:32 13m retest repro linux-4.14.y report log
2023/02/11 05:32 9m retest repro linux-4.14.y report log
2023/02/11 04:32 9m retest repro linux-4.14.y report log
2023/02/11 03:32 13m retest repro linux-4.14.y report log
2023/02/11 02:32 10m retest repro linux-4.14.y report log
2023/02/11 00:32 10m retest repro linux-4.14.y report log
2023/02/10 23:32 9m retest repro linux-4.14.y report log
Fix bisection attempts (15)
Created Duration User Patch Repo Result
2022/03/04 15:38 0m bisect fix linux-4.14.y error job log
2022/02/02 14:59 38m bisect fix linux-4.14.y OK (0) job log log
2022/01/03 14:28 31m bisect fix linux-4.14.y OK (0) job log log
2021/12/04 13:45 37m bisect fix linux-4.14.y OK (0) job log log
2021/11/04 13:02 33m bisect fix linux-4.14.y OK (0) job log log
2021/10/05 12:24 37m bisect fix linux-4.14.y OK (0) job log log
2021/09/05 10:44 34m bisect fix linux-4.14.y OK (0) job log log
2021/08/06 10:14 30m bisect fix linux-4.14.y OK (0) job log log
2021/07/07 09:44 29m bisect fix linux-4.14.y OK (0) job log log
2021/06/07 09:08 36m bisect fix linux-4.14.y OK (0) job log log
2021/01/27 14:12 38m bisect fix linux-4.14.y OK (0) job log log
2020/12/03 14:58 41m bisect fix linux-4.14.y OK (0) job log log
2020/11/03 14:19 39m bisect fix linux-4.14.y OK (0) job log log
2020/10/04 13:17 39m bisect fix linux-4.14.y OK (0) job log log
2020/09/04 09:32 44m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
==================================================================
BUG: KASAN: use-after-free in xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:208 [inline]
BUG: KASAN: use-after-free in xfrm6_tunnel_destroy+0x519/0x5c0 net/ipv6/xfrm6_tunnel.c:303
Read of size 8 at addr ffff88809e0721b8 by task kworker/1:1/23

CPU: 1 PID: 23 Comm: kworker/1:1 Not tainted 4.14.173-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events xfrm_state_gc_task
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x13e/0x194 lib/dump_stack.c:58
 print_address_description.cold+0x7c/0x1e2 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2ae mm/kasan/report.c:393
 xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:208 [inline]
 xfrm6_tunnel_destroy+0x519/0x5c0 net/ipv6/xfrm6_tunnel.c:303
 xfrm_state_gc_destroy net/xfrm/xfrm_state.c:449 [inline]
 xfrm_state_gc_task+0x4ad/0x7d0 net/xfrm/xfrm_state.c:472
 process_one_work+0x813/0x1540 kernel/workqueue.c:2114
 worker_thread+0x5d1/0x1070 kernel/workqueue.c:2248
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 7443:
 save_stack+0x32/0xa0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:529
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc+0x15b/0x7c0 mm/slab.c:3729
 kmalloc include/linux/slab.h:493 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 ops_init+0xe7/0x3c0 net/core/net_namespace.c:108
 setup_net+0x22f/0x500 net/core/net_namespace.c:295
 copy_net_ns+0x19b/0x440 net/core/net_namespace.c:419
 create_new_namespaces+0x375/0x730 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xa5/0x1e0 kernel/nsproxy.c:206
 SYSC_unshare kernel/fork.c:2391 [inline]
 SyS_unshare+0x2ea/0x740 kernel/fork.c:2341
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 878:
 save_stack+0x32/0xa0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcb/0x260 mm/slab.c:3815
 ops_free net/core/net_namespace.c:132 [inline]
 ops_free_list.part.0+0x1f9/0x330 net/core/net_namespace.c:154
 ops_free_list net/core/net_namespace.c:152 [inline]
 cleanup_net+0x453/0x820 net/core/net_namespace.c:488
 process_one_work+0x813/0x1540 kernel/workqueue.c:2114
 worker_thread+0x5d1/0x1070 kernel/workqueue.c:2248
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

The buggy address belongs to the object at ffff88809e0719c0
 which belongs to the cache kmalloc-8192 of size 8192
The buggy address is located 2040 bytes inside of
 8192-byte region [ffff88809e0719c0, ffff88809e0739c0)
The buggy address belongs to the page:
page:ffffea0002781c00 count:1 mapcount:0 mapping:ffff88809e0719c0 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff88809e0719c0 0000000000000000 0000000100000001
raw: ffffea00026e9b20 ffffea00026d5b20 ffff88812fe55080 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809e072080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809e072100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809e072180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                        ^
 ffff88809e072200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809e072280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1692):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/17 15:00 linux-4.14.y 12cd844a39ed 749688d2 .config console log report syz C ci2-linux-4-14
2019/11/22 03:57 linux-4.14.y f56f3d0e65ad 8098ea0f .config console log report syz C ci2-linux-4-14
2019/11/06 20:03 linux-4.14.y c9fda4f22428 da505f84 .config console log report syz C ci2-linux-4-14
2019/10/31 04:23 linux-4.14.y ddef1e8e3f6e a41ca8fa .config console log report syz C ci2-linux-4-14
2019/10/24 00:54 linux-4.14.y b98aebd29824 b602d64b .config console log report syz C ci2-linux-4-14
2019/10/20 03:35 linux-4.14.y b98aebd29824 8c88c9c1 .config console log report syz C ci2-linux-4-14
2019/09/22 15:44 linux-4.14.y f6e27dbb1afa d96e88f3 .config console log report syz C ci2-linux-4-14
2019/09/22 10:15 linux-4.14.y f6e27dbb1afa d96e88f3 .config console log report syz C ci2-linux-4-14
2019/07/03 04:05 linux-4.14.y f4cc0ed9b2c7 55565fa0 .config console log report syz C ci2-linux-4-14
2019/06/28 20:16 linux-4.14.y f4cc0ed9b2c7 7509bf36 .config console log report syz C ci2-linux-4-14
2019/04/30 09:24 linux-4.14.y fa5941f45d7e 20f16bef .config console log report syz C ci2-linux-4-14
2019/04/28 21:35 linux-4.14.y fa5941f45d7e b617407b .config console log report syz C ci2-linux-4-14
2019/04/16 20:48 linux-4.14.y 1ec8f1f0bffe 505ab413 .config console log report syz ci2-linux-4-14
2021/05/08 09:07 linux-4.14.y 7d7d1c0ab3eb bc5434be .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/05/04 02:54 linux-4.14.y 7d7d1c0ab3eb 09efdd63 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/05/01 13:47 linux-4.14.y 7d7d1c0ab3eb 77e2b668 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/04/20 07:58 linux-4.14.y cf256fbcbe34 c0ced557 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/04/10 03:26 linux-4.14.y 0cc244011f40 6a81331a .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/04/08 10:58 linux-4.14.y 0cc244011f40 6a81331a .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/03/21 06:50 linux-4.14.y cb83ddcd5332 17810eae .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/03/16 16:16 linux-4.14.y c7150cd2fa8c fdb2bb2c .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/03/10 09:04 linux-4.14.y 1d177c0872ab 26967e35 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/02/25 15:17 linux-4.14.y 3242aa3a635c 76f7fc95 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2021/02/22 14:13 linux-4.14.y 29c52025152b c26fb06b .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in xfrm6_tunnel_destroy
2020/12/28 14:08 linux-4.14.y 3f2ecb86cb90 8259d56c .config console log report info ci2-linux-4-14
2020/08/05 09:31 linux-4.14.y ca4f2c56d416 b7129355 .config console log report ci2-linux-4-14
2020/08/04 18:39 linux-4.14.y 7f2c5eb458b8 80a06902 .config console log report ci2-linux-4-14
2020/07/31 08:21 linux-4.14.y e5a54aa2d312 8df85ed9 .config console log report ci2-linux-4-14
2020/07/29 02:48 linux-4.14.y 69b94dd6dcd1 cb93dc6a .config console log report ci2-linux-4-14
2020/07/24 22:58 linux-4.14.y 69b94dd6dcd1 0a13649c .config console log report ci2-linux-4-14
2020/07/18 23:27 linux-4.14.y b850307b279c 9c812472 .config console log report ci2-linux-4-14
2020/07/13 01:29 linux-4.14.y b850307b279c 9ebcc5b1 .config console log report ci2-linux-4-14
2020/07/07 05:42 linux-4.14.y b850307b279c ef278c73 .config console log report ci2-linux-4-14
2020/06/27 08:10 linux-4.14.y b850307b279c ffec44b5 .config console log report ci2-linux-4-14
2020/06/20 15:54 linux-4.14.y b850307b279c c655ec77 .config console log report ci2-linux-4-14
2020/06/14 11:37 linux-4.14.y b850307b279c 2a22c77a .config console log report ci2-linux-4-14
2020/06/12 11:22 linux-4.14.y b850307b279c 819b58b0 .config console log report ci2-linux-4-14
2020/06/11 08:20 linux-4.14.y b850307b279c 3ab7a05a .config console log report ci2-linux-4-14
2020/06/10 07:25 linux-4.14.y c6db52a88798 860c4de9 .config console log report ci2-linux-4-14
2020/06/10 02:13 linux-4.14.y c6db52a88798 860c4de9 .config console log report ci2-linux-4-14
2020/06/10 00:55 linux-4.14.y c6db52a88798 860c4de9 .config console log report ci2-linux-4-14
2020/06/09 12:05 linux-4.14.y c6db52a88798 0d60b78a .config console log report ci2-linux-4-14
2020/06/08 11:08 linux-4.14.y c6db52a88798 7604bb03 .config console log report ci2-linux-4-14
2020/06/07 02:44 linux-4.14.y c6db52a88798 e6b89e4e .config console log report ci2-linux-4-14
2020/05/31 21:31 linux-4.14.y 4f68020fef1c a0331e89 .config console log report ci2-linux-4-14
2020/05/26 10:29 linux-4.14.y a41ba30d9df2 8ca3b7d2 .config console log report ci2-linux-4-14
2020/05/25 00:56 linux-4.14.y a41ba30d9df2 11284182 .config console log report ci2-linux-4-14
2020/05/22 03:42 linux-4.14.y a41ba30d9df2 4afdfa20 .config console log report ci2-linux-4-14
2020/04/28 06:55 linux-4.14.y 050272a0423e 0ce7569e .config console log report ci2-linux-4-14
2020/04/27 22:54 linux-4.14.y 050272a0423e 0ce7569e .config console log report ci2-linux-4-14
2020/04/25 16:57 linux-4.14.y 050272a0423e a113ba38 .config console log report ci2-linux-4-14
2020/04/25 04:01 linux-4.14.y 050272a0423e 03d97a1b .config console log report ci2-linux-4-14
2020/04/25 00:51 linux-4.14.y 050272a0423e 03d97a1b .config console log report ci2-linux-4-14
2020/04/24 23:12 linux-4.14.y 050272a0423e 03d97a1b .config console log report ci2-linux-4-14
2020/04/23 10:26 linux-4.14.y c10b57a567e4 2e44d63e .config console log report ci2-linux-4-14
2020/04/23 07:14 linux-4.14.y c10b57a567e4 2e44d63e .config console log report ci2-linux-4-14
2020/04/23 02:05 linux-4.14.y c10b57a567e4 2e44d63e .config console log report ci2-linux-4-14
2019/04/12 03:11 linux-4.14.y 1ec8f1f0bffe 8916f5e1 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.