syzbot


KASAN: null-ptr-deref Read in tcf_generic_walker

Status: fixed on 2020/02/18 14:31
Subsystems: net
[Documentation on labels]
Fix commit: 760d228e322e net_sched: walk through all child classes in tc_bind_tclass()
First crash: 1605d, last: 1587d
Cause bisection: introduced by (bisect log) :
commit 16bbeb2b43c3f5d69e1348477e75a24ae6d55d5a
Author: Gustavo A. R. Silva <gustavo@embeddedor.com>
Date: Fri Aug 3 16:29:53 2018 +0000

  ASoC: fsl_esai: Mark expected switch fall-through

Crash: general protection fault in batadv_iv_ogm_queue_add (log)
Repro: C syz .config
  

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
BUG: KASAN: null-ptr-deref in tcf_idr_release_unsafe net/sched/act_api.c:277 [inline]
BUG: KASAN: null-ptr-deref in tcf_del_walker net/sched/act_api.c:308 [inline]
BUG: KASAN: null-ptr-deref in tcf_generic_walker+0x73f/0xc00 net/sched/act_api.c:337
Read of size 4 at addr 0000000000000010 by task syz-executor560/10809

CPU: 0 PID: 10809 Comm: syz-executor560 Not tainted 5.5.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 __kasan_report.cold+0x5/0x32 mm/kasan/report.c:510
 kasan_report+0x12/0x20 mm/kasan/common.c:639
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192
 __kasan_check_read+0x11/0x20 mm/kasan/common.c:95
 atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
 tcf_idr_release_unsafe net/sched/act_api.c:277 [inline]
 tcf_del_walker net/sched/act_api.c:308 [inline]
 tcf_generic_walker+0x73f/0xc00 net/sched/act_api.c:337
 tcf_ife_walker+0x1a0/0x2b0 net/sched/act_ife.c:866
 tca_action_flush net/sched/act_api.c:1237 [inline]
 tca_action_gd+0xcec/0x1760 net/sched/act_api.c:1344
 tc_ctl_action+0x3be/0x488 net/sched/act_api.c:1473
 rtnetlink_rcv_msg+0x45e/0xaf0 net/core/rtnetlink.c:5438
 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477
 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5456
 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
 netlink_unicast+0x59e/0x7e0 net/netlink/af_netlink.c:1328
 netlink_sendmsg+0x91c/0xea0 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xd7/0x130 net/socket.c:672
 ____sys_sendmsg+0x753/0x880 net/socket.c:2343
 ___sys_sendmsg+0x100/0x170 net/socket.c:2397
 __sys_sendmsg+0x105/0x1d0 net/socket.c:2430
 __do_sys_sendmsg net/socket.c:2439 [inline]
 __se_sys_sendmsg net/socket.c:2437 [inline]
 __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2437
 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x446939
Code: e8 0c e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 5b 07 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f7b06402da8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446939
RDX: 0000000000000000 RSI: 0000000020000300 RDI: 0000000000000003
RBP: 00000000006dbc20 R08: 0000000000000008 R09: 0000000000000000
R10: 000000000000000c R11: 0000000000000246 R12: 00000000006dbc2c
R13: 0000000020000400 R14: 00000000004ae7e8 R15: 000000000000002d
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/01/30 03:35 upstream b3a608222336 5ed23f9a .config console log report syz C ci-upstream-kasan-gce-selinux-root
2020/01/29 07:42 upstream c677124e631d c8e81ce4 .config console log report syz C ci-upstream-kasan-gce-root
2020/01/27 08:39 upstream a45ea48e2bcd dd56146d .config console log report syz C ci-upstream-kasan-gce-smack-root
2020/01/27 08:18 net-old 2821e26f3a0a dd56146d .config console log report syz C ci-upstream-net-this-kasan-gce
2020/01/27 08:29 net-next-old 14a1d2468ab3 dd56146d .config console log report syz C ci-upstream-net-kasan-gce
2020/02/14 17:23 linux-next 9f01828e9e16 5d7b90f1 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.