syzbot


KASAN: use-after-free Read in u32_clear_hnode

Status: upstream: reported C repro on 2020/03/01 19:53
Reported-by: syzbot+4447d810a162677c0f57@syzkaller.appspotmail.com
First crash: 1568d, last: 840d
Fix bisection: failed (error log, bisect log)
  
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/02/14 11:32 11m retest repro linux-4.14.y report log
2022/10/04 17:30 14m retest repro linux-4.14.y report log
Fix bisection attempts (15)
Created Duration User Patch Repo Result
2022/03/29 20:38 16m bisect fix linux-4.14.y error job log (0)
2022/02/27 11:00 26m bisect fix linux-4.14.y job log (0) log
2022/01/28 10:33 26m bisect fix linux-4.14.y job log (0) log
2021/12/29 10:05 28m bisect fix linux-4.14.y job log (0) log
2021/11/29 09:39 26m bisect fix linux-4.14.y job log (0) log
2021/10/30 09:10 28m bisect fix linux-4.14.y job log (0) log
2021/09/28 15:41 31m bisect fix linux-4.14.y job log (0) log
2021/08/29 15:11 28m bisect fix linux-4.14.y job log (0) log
2021/07/30 11:03 29m bisect fix linux-4.14.y job log (0) log
2021/06/30 10:11 22m bisect fix linux-4.14.y job log (0) log
2021/05/31 09:43 27m bisect fix linux-4.14.y job log (0) log
2021/05/01 08:51 21m bisect fix linux-4.14.y job log (0) log
2021/04/01 08:28 22m bisect fix linux-4.14.y job log (0) log
2021/02/05 21:33 0m bisect fix linux-4.14.y error job log (0)
2021/01/06 21:09 23m bisect fix linux-4.14.y job log (0) 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 u32_clear_hnode+0x37d/0x410 net/sched/cls_u32.c:590
Read of size 8 at addr ffff88808c1756b0 by task kworker/u4:5/4257

CPU: 1 PID: 4257 Comm: kworker/u4:5 Not tainted 4.14.195-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: netns cleanup_net
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 u32_clear_hnode+0x37d/0x410 net/sched/cls_u32.c:590
 u32_destroy+0x1e7/0x3f0 net/sched/cls_u32.c:655
 tcf_proto_destroy net/sched/cls_api.c:180 [inline]
 tcf_chain_flush+0x147/0x2b0 net/sched/cls_api.c:208
 tcf_block_put+0xd0/0x220 net/sched/cls_api.c:302
 hfsc_destroy_qdisc+0xd8/0x350 net/sched/sch_hfsc.c:1504
 qdisc_destroy+0x13c/0x310 net/sched/sch_generic.c:726
 dev_shutdown+0x27a/0x43e net/sched/sch_generic.c:1001
 rollback_registered_many+0x6e0/0xb30 net/core/dev.c:7196
 unregister_netdevice_many.part.0+0x18/0x2e0 net/core/dev.c:8284
 unregister_netdevice_many+0x36/0x50 net/core/dev.c:8283
 ip_tunnel_delete_net+0x274/0x320 net/ipv4/ip_tunnel.c:1083
 ops_exit_list+0xa5/0x150 net/core/net_namespace.c:142
 cleanup_net+0x3b3/0x840 net/core/net_namespace.c:484
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 6386:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 u32_init+0x3e4/0x884 net/sched/cls_u32.c:367
 tcf_proto_create net/sched/cls_api.c:166 [inline]
 tc_ctl_tfilter+0xde3/0x1c01 net/sched/cls_api.c:677
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4316
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2433
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x326/0x800 net/socket.c:2062
 __sys_sendmmsg+0x129/0x330 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x2f/0x50 net/socket.c:2178
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 4257:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 u32_destroy_key.constprop.0.isra.0+0x105/0x1d0 net/sched/cls_u32.c:406
 u32_clear_hnode+0x2de/0x410 net/sched/cls_u32.c:598
 u32_destroy+0x1e7/0x3f0 net/sched/cls_u32.c:655
 tcf_proto_destroy net/sched/cls_api.c:180 [inline]
 tcf_chain_flush+0x147/0x2b0 net/sched/cls_api.c:208
 tcf_block_put+0xd0/0x220 net/sched/cls_api.c:302
 hfsc_destroy_qdisc+0xd8/0x350 net/sched/sch_hfsc.c:1504
 qdisc_destroy+0x13c/0x310 net/sched/sch_generic.c:726
 dev_shutdown+0x27a/0x43e net/sched/sch_generic.c:1001
 rollback_registered_many+0x6e0/0xb30 net/core/dev.c:7196
 unregister_netdevice_many.part.0+0x18/0x2e0 net/core/dev.c:8284
 unregister_netdevice_many+0x36/0x50 net/core/dev.c:8283
 ip_tunnel_delete_net+0x274/0x320 net/ipv4/ip_tunnel.c:1083
 ops_exit_list+0xa5/0x150 net/core/net_namespace.c:142
 cleanup_net+0x3b3/0x840 net/core/net_namespace.c:484
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
 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 ffff88808c175680
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 48 bytes inside of
 64-byte region [ffff88808c175680, ffff88808c1756c0)
The buggy address belongs to the page:
page:ffffea0002305d40 count:1 mapcount:0 mapping:ffff88808c175000 index:0xffff88808c175f80
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffff88808c175000 ffff88808c175f80 000000010000001e
raw: ffffea0002703120 ffffea00021e5520 ffff88812fe52340 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808c175580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88808c175600: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88808c175680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                                     ^
 ffff88808c175700: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
 ffff88808c175780: 00 00 00 00 00 00 00 06 fc fc fc fc fc fc fc fc
==================================================================

Crashes (123):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/09/01 02:38 linux-4.14.y d7e78d08fa77 d5a3ae1f .config console log report syz C ci2-linux-4-14
2021/03/02 08:28 linux-4.14.y 3242aa3a635c 92ead296 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in u32_clear_hnode
2021/02/26 10:18 linux-4.14.y 3242aa3a635c 4c37c133 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in u32_clear_hnode
2021/02/23 02:54 linux-4.14.y 29c52025152b fcc6d71b .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in u32_clear_hnode
2021/02/22 13:40 linux-4.14.y 29c52025152b c26fb06b .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in u32_clear_hnode
2021/02/22 10:37 linux-4.14.y 29c52025152b a659b3f1 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in u32_clear_hnode
2021/02/21 01:34 linux-4.14.y 29c52025152b 3e5ed8b4 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in u32_clear_hnode
2021/02/19 09:58 linux-4.14.y 2c8a3fceddf0 14052202 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in u32_clear_hnode
2021/02/17 19:50 linux-4.14.y 2c8a3fceddf0 14052202 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in u32_clear_hnode
2020/12/07 20:40 linux-4.14.y c196b3a9c83a 51a9082e .config console log report info ci2-linux-4-14
2020/12/06 21:33 linux-4.14.y c196b3a9c83a c521566d .config console log report info ci2-linux-4-14
2020/12/05 20:33 linux-4.14.y c196b3a9c83a 50503117 .config console log report info ci2-linux-4-14
2020/12/05 15:04 linux-4.14.y c196b3a9c83a 0ef84591 .config console log report info ci2-linux-4-14
2020/12/05 09:00 linux-4.14.y c196b3a9c83a 0ef84591 .config console log report info ci2-linux-4-14
2020/12/04 19:15 linux-4.14.y c196b3a9c83a 20366b87 .config console log report info ci2-linux-4-14
2020/12/02 11:50 linux-4.14.y c196b3a9c83a eff43e99 .config console log report info ci2-linux-4-14
2020/12/02 08:32 linux-4.14.y c196b3a9c83a c42a35e9 .config console log report info ci2-linux-4-14
2020/11/29 00:56 linux-4.14.y 87335852c5d9 a0092f9d .config console log report info ci2-linux-4-14
2020/11/28 11:30 linux-4.14.y 87335852c5d9 486f93ef .config console log report info ci2-linux-4-14
2020/11/27 13:31 linux-4.14.y 87335852c5d9 486f93ef .config console log report info ci2-linux-4-14
2020/11/27 01:14 linux-4.14.y 87335852c5d9 5018c946 .config console log report info ci2-linux-4-14
2020/11/26 13:31 linux-4.14.y 87335852c5d9 2f1cec62 .config console log report info ci2-linux-4-14
2020/11/13 11:04 linux-4.14.y 27ce4f2a6817 4a7fa9b4 .config console log report info ci2-linux-4-14
2020/11/12 23:35 linux-4.14.y 27ce4f2a6817 16fca0c8 .config console log report info ci2-linux-4-14
2020/11/12 11:13 linux-4.14.y 27ce4f2a6817 77a55c8e .config console log report info ci2-linux-4-14
2020/11/10 23:27 linux-4.14.y 27ce4f2a6817 cca87986 .config console log report info ci2-linux-4-14
2020/11/10 12:20 linux-4.14.y e98f3c4269fd cca87986 .config console log report info ci2-linux-4-14
2020/11/10 10:29 linux-4.14.y e98f3c4269fd cca87986 .config console log report info ci2-linux-4-14
2020/11/10 08:01 linux-4.14.y 6b6446efedb2 cca87986 .config console log report info ci2-linux-4-14
2020/11/09 12:24 linux-4.14.y 6b6446efedb2 cba33199 .config console log report info ci2-linux-4-14
2020/11/05 11:36 linux-4.14.y 6b6446efedb2 cba33199 .config console log report info ci2-linux-4-14
2020/11/02 21:05 linux-4.14.y 2b7915014161 7f344fa6 .config console log report info ci2-linux-4-14
2020/11/02 14:26 linux-4.14.y 2b7915014161 8bc4594f .config console log report info ci2-linux-4-14
2020/10/31 10:22 linux-4.14.y 2b7915014161 8bc4594f .config console log report info ci2-linux-4-14
2020/10/30 01:55 linux-4.14.y 2b7915014161 a0c7169a .config console log report info ci2-linux-4-14
2020/10/29 17:33 linux-4.14.y 2b7915014161 a0c7169a .config console log report info ci2-linux-4-14
2020/10/27 22:52 linux-4.14.y 5b7a52cd2eef 96e03c1c .config console log report info ci2-linux-4-14
2020/10/27 10:42 linux-4.14.y 5b7a52cd2eef 94942294 .config console log report info ci2-linux-4-14
2020/10/26 22:25 linux-4.14.y 5b7a52cd2eef 8b3eaf58 .config console log report info ci2-linux-4-14
2020/10/26 10:09 linux-4.14.y 5b7a52cd2eef a7aac492 .config console log report info ci2-linux-4-14
2020/10/24 13:25 linux-4.14.y 5b7a52cd2eef a1839e81 .config console log report info ci2-linux-4-14
2020/10/24 11:53 linux-4.14.y 5b7a52cd2eef a1839e81 .config console log report info ci2-linux-4-14
2020/10/23 20:33 linux-4.14.y 5b7a52cd2eef 2bb6666c .config console log report info ci2-linux-4-14
2020/10/21 13:08 linux-4.14.y 5b7a52cd2eef 99c64d5c .config console log report info ci2-linux-4-14
2020/10/21 09:25 linux-4.14.y cbfa1702aaf6 e761439e .config console log report info ci2-linux-4-14
2020/10/19 23:06 linux-4.14.y cbfa1702aaf6 ff4a3345 .config console log report info ci2-linux-4-14
2020/03/01 19:53 linux-4.14.y 78d697fc93f9 c88c7b75 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.