syzbot


general protection fault in can_rx_register

Status: upstream: reported C repro on 2020/01/17 13:46
Reported-by: syzbot+c3ea30e1e2485573f953@syzkaller.appspotmail.com
First crash: 985d, last: 41d

Cause bisection: introduced by (bisect log) :
commit 9868b5d44f3df9dd75247acd23dddff0a42f79be
Author: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Date: Mon Oct 8 09:48:33 2018 +0000

  can: introduce CAN_REQUIRED_SIZE macro

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

Fix bisection: failed (bisect log)
Patch testing requests:
Created Duration User Patch Repo Result
2020/10/18 20:58 19m anmol.karan123@gmail.com patch upstream OK
2020/10/02 11:07 10m anmol.karan123@gmail.com upstream report log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 0 PID: 3608 Comm: syz-executor219 Not tainted 6.0.0-rc1-syzkaller-00025-g274a2eebf80c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
RIP: 0010:hlist_add_head_rcu include/linux/rculist.h:587 [inline]
RIP: 0010:can_rx_register+0x480/0x660 net/can/af_can.c:477
Code: 8b 6c 24 70 49 89 5f 30 49 8d 7f 38 48 89 f8 48 c1 e8 03 42 80 3c 28 00 74 05 e8 5b d3 9b f8 49 89 6f 38 4c 89 f3 48 c1 eb 03 <42> 80 3c 2b 00 74 08 4c 89 f7 e8 c1 d2 9b f8 4d 8b 26 4c 89 f8 48
RSP: 0018:ffffc900038ffcb8 EFLAGS: 00010202
RAX: 1ffff1100e44be07 RBX: 0000000000000001 RCX: ffff888027638000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88807225f038
RBP: ffff888018226000 R08: ffffffff8941621c R09: fffff5200071ff88
R10: fffff5200071ff89 R11: 1ffff9200071ff88 R12: 0000000000000000
R13: dffffc0000000000 R14: 0000000000000008 R15: ffff88807225f000
FS:  00007fee4cc17700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fac7f82eff8 CR3: 000000001f7af000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 raw_enable_filters net/can/raw.c:193 [inline]
 raw_enable_allfilters net/can/raw.c:259 [inline]
 raw_bind+0x352/0xfe0 net/can/raw.c:455
 __sys_bind+0x233/0x2e0 net/socket.c:1776
 __do_sys_bind net/socket.c:1787 [inline]
 __se_sys_bind net/socket.c:1785 [inline]
 __x64_sys_bind+0x76/0x80 net/socket.c:1785
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fee4cc65d19
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 90 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fee4cc17318 EFLAGS: 00000246 ORIG_RAX: 0000000000000031
RAX: ffffffffffffffda RBX: 00007fee4cced428 RCX: 00007fee4cc65d19
RDX: 0000000000000010 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 00007fee4cced420 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fee4ccbb064
R13: 00007ffe7f6d3b7f R14: 00007fee4cc17400 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:hlist_add_head_rcu include/linux/rculist.h:587 [inline]
RIP: 0010:can_rx_register+0x480/0x660 net/can/af_can.c:477
Code: 8b 6c 24 70 49 89 5f 30 49 8d 7f 38 48 89 f8 48 c1 e8 03 42 80 3c 28 00 74 05 e8 5b d3 9b f8 49 89 6f 38 4c 89 f3 48 c1 eb 03 <42> 80 3c 2b 00 74 08 4c 89 f7 e8 c1 d2 9b f8 4d 8b 26 4c 89 f8 48
RSP: 0018:ffffc900038ffcb8 EFLAGS: 00010202
RAX: 1ffff1100e44be07 RBX: 0000000000000001 RCX: ffff888027638000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88807225f038
RBP: ffff888018226000 R08: ffffffff8941621c R09: fffff5200071ff88
R10: fffff5200071ff89 R11: 1ffff9200071ff88 R12: 0000000000000000
R13: dffffc0000000000 R14: 0000000000000008 R15: ffff88807225f000
FS:  00007fee4cc17700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fac7f82eff8 CR3: 000000001f7af000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	8b 6c 24 70          	mov    0x70(%rsp),%ebp
   4:	49 89 5f 30          	mov    %rbx,0x30(%r15)
   8:	49 8d 7f 38          	lea    0x38(%r15),%rdi
   c:	48 89 f8             	mov    %rdi,%rax
   f:	48 c1 e8 03          	shr    $0x3,%rax
  13:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
  18:	74 05                	je     0x1f
  1a:	e8 5b d3 9b f8       	callq  0xf89bd37a
  1f:	49 89 6f 38          	mov    %rbp,0x38(%r15)
  23:	4c 89 f3             	mov    %r14,%rbx
  26:	48 c1 eb 03          	shr    $0x3,%rbx
* 2a:	42 80 3c 2b 00       	cmpb   $0x0,(%rbx,%r13,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	4c 89 f7             	mov    %r14,%rdi
  34:	e8 c1 d2 9b f8       	callq  0xf89bd2fa
  39:	4d 8b 26             	mov    (%r14),%r12
  3c:	4c 89 f8             	mov    %r15,%rax
  3f:	48                   	rex.W

Crashes (17):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-smack-root 2022/08/18 09:39 upstream 274a2eebf80c d58e263f .config log report syz C general protection fault in can_rx_register
ci-upstream-kasan-gce-root 2022/07/02 11:41 upstream 089866061428 1434eec0 .config log report syz C general protection fault in can_rx_register
ci-upstream-kasan-gce-selinux-root 2022/05/12 11:10 upstream feb9c5e19e91 beb0b407 .config log report syz C general protection fault in can_rx_register
ci-upstream-net-this-kasan-gce 2022/05/12 13:06 net a48ab883c4a9 beb0b407 .config log report syz C general protection fault in can_rx_register
ci-upstream-linux-next-kasan-gce-root 2022/08/07 23:27 linux-next cb71b93c2dc3 88e3a122 .config log report syz C general protection fault in can_rx_register
ci-upstream-kasan-gce-selinux-root 2020/01/17 11:35 upstream f4353c3e2aaf 3de7aabb .config log report syz C
ci-upstream-kasan-gce-smack-root 2020/01/17 05:11 upstream f5ae2ea6347a 3de7aabb .config log report syz C
ci-upstream-kasan-gce 2020/01/17 03:01 upstream f5ae2ea6347a 3de7aabb .config log report syz C
ci-upstream-net-this-kasan-gce 2020/01/17 04:09 net 567110f147b3 3de7aabb .config log report syz C
ci-upstream-net-kasan-gce 2020/01/17 03:57 net-next 1ccf6c13d9c7 3de7aabb .config log report syz
ci-upstream-kasan-gce-selinux-root 2022/05/12 05:05 upstream feb9c5e19e91 beb0b407 .config log report info general protection fault in can_rx_register
ci-qemu-upstream-386 2022/05/25 23:37 upstream fdaf9a5840ac 3037caa9 .config log report info general protection fault in can_rx_register
ci-upstream-kasan-gce-smack-root 2020/04/20 19:31 upstream ae83d0b416db 347a5dc3 .config log report
ci-upstream-kasan-gce 2020/01/17 01:21 upstream f5ae2ea6347a 3de7aabb .config log report
ci-upstream-kasan-gce-386 2020/09/29 23:43 upstream ccc1d052eff9 5abc3f1a .config log report info
ci-upstream-net-this-kasan-gce 2020/04/17 08:05 net 2fcd80144b93 18397578 .config log report
ci-upstream-net-this-kasan-gce 2020/04/16 00:33 net 91fac45cd006 3f3c5574 .config log report
* Struck through repros no longer work on HEAD.