syzbot


general protection fault in j1939_netdev_notify

Status: fixed on 2019/11/29 15:48
Subsystems: can
[Documentation on labels]
Reported-by: syzbot+95c8e0d9dffde15b6c5c@syzkaller.appspotmail.com
Fix commit: c48c8c1e2e81 can: j1939: main: j1939_ndev_to_priv(): avoid crash if can_ml_priv is NULL
First crash: 1624d, last: 1612d
Cause bisection: introduced by (bisect log) :
commit 9d71dd0c70099914fcd063135da3c580865e924c
Author: The j1939 authors <linux-can@vger.kernel.org>
Date: Mon Oct 8 09:48:36 2018 +0000

  can: add support of SAE J1939 protocol

Crash: general protection fault in j1939_priv_get_by_ndev_locked (log)
Repro: syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH v1 0/9] can: j1939: fix multiple issues found by syzbot 16 (16) 2019/11/13 10:04
[PATCH 3/9] can: j1939: main: j1939_ndev_to_priv(): avoid crash if can_ml_priv is NULL 1 (1) 2019/11/13 09:55
general protection fault in j1939_netdev_notify 0 (1) 2019/11/05 04:22
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in j1939_netdev_notify (2) can C done 19 1155d 1213d 20/26 fixed on 2021/04/09 19:46

Sample crash report:
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 7896 Comm: syz-executor.0 Not tainted 5.4.0-rc6+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:j1939_ndev_to_priv net/can/j1939/main.c:210 [inline]
RIP: 0010:j1939_priv_get_by_ndev_locked net/can/j1939/main.c:222 [inline]
RIP: 0010:j1939_priv_get_by_ndev net/can/j1939/main.c:234 [inline]
RIP: 0010:j1939_netdev_notify+0x10a/0x2c0 net/can/j1939/main.c:344
Code: 88 05 00 00 4c 89 e0 48 c1 e8 03 42 80 3c 28 00 74 08 4c 89 e7 e8 36 90 fc fa bb 28 60 00 00 49 03 1c 24 48 89 d8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 df e8 17 90 fc fa 4c 8b 2b 4d 85 ed 0f
RSP: 0018:ffff8880986279d0 EFLAGS: 00010206
RAX: 0000000000000c05 RBX: 0000000000006028 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000118 RDI: 0000000000000118
RBP: ffff888098627a00 R08: ffffffff86b00481 R09: ffffed10130c4f2f
R10: ffffed10130c4f2f R11: 0000000000000000 R12: ffff88809a018588
R13: dffffc0000000000 R14: ffff88809a01823c R15: 1ffff11013403047
FS:  0000000001eae940(0000) GS:ffff8880aeb00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004dcd48 CR3: 0000000092f8b000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 notifier_call_chain kernel/notifier.c:95 [inline]
 __raw_notifier_call_chain kernel/notifier.c:396 [inline]
 raw_notifier_call_chain+0xec/0x190 kernel/notifier.c:403
 call_netdevice_notifiers_info net/core/dev.c:1668 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:1680 [inline]
 call_netdevice_notifiers net/core/dev.c:1694 [inline]
 rollback_registered_many+0xbd6/0x11c0 net/core/dev.c:8522
 rollback_registered net/core/dev.c:8564 [inline]
 unregister_netdevice_queue+0x2ce/0x480 net/core/dev.c:9656
 unregister_netdevice include/linux/netdevice.h:2637 [inline]
 unregister_netdev+0x1c/0x30 net/core/dev.c:9697
 slip_close+0x160/0x190 drivers/net/slip/slip.c:895
 tty_ldisc_close+0x126/0x180 drivers/tty/tty_ldisc.c:494
 tty_ldisc_kill drivers/tty/tty_ldisc.c:642 [inline]
 tty_ldisc_release+0x248/0x5a0 drivers/tty/tty_ldisc.c:814
 tty_release_struct+0x2a/0xe0 drivers/tty/tty_io.c:1612
 tty_release+0xce9/0xfa0 drivers/tty/tty_io.c:1785
 __fput+0x2e4/0x740 fs/file_table.c:280
 ____fput+0x15/0x20 fs/file_table.c:313
 task_work_run+0x17e/0x1b0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:188 [inline]
 exit_to_usermode_loop arch/x86/entry/common.c:163 [inline]
 prepare_exit_to_usermode+0x459/0x580 arch/x86/entry/common.c:194
 syscall_return_slowpath+0x113/0x4a0 arch/x86/entry/common.c:274
 do_syscall_64+0x11f/0x1c0 arch/x86/entry/common.c:300
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x413d90
Code: 01 f0 ff ff 0f 83 30 1b 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 7d 42 66 00 00 75 14 b8 03 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 04 1b 00 00 c3 48 83 ec 08 e8 0a fc ff ff
RSP: 002b:00007ffc639f4188 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000413d90
RDX: 0000001b2ec20000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffffffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000075bf20
R13: 0000000000000003 R14: 00000000007602f8 R15: 000000000075bf2c
Modules linked in:
---[ end trace d26041b23944f8c8 ]---
RIP: 0010:j1939_ndev_to_priv net/can/j1939/main.c:210 [inline]
RIP: 0010:j1939_priv_get_by_ndev_locked net/can/j1939/main.c:222 [inline]
RIP: 0010:j1939_priv_get_by_ndev net/can/j1939/main.c:234 [inline]
RIP: 0010:j1939_netdev_notify+0x10a/0x2c0 net/can/j1939/main.c:344
Code: 88 05 00 00 4c 89 e0 48 c1 e8 03 42 80 3c 28 00 74 08 4c 89 e7 e8 36 90 fc fa bb 28 60 00 00 49 03 1c 24 48 89 d8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 df e8 17 90 fc fa 4c 8b 2b 4d 85 ed 0f
RSP: 0018:ffff8880986279d0 EFLAGS: 00010206
RAX: 0000000000000c05 RBX: 0000000000006028 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000118 RDI: 0000000000000118
RBP: ffff888098627a00 R08: ffffffff86b00481 R09: ffffed10130c4f2f
R10: ffffed10130c4f2f R11: 0000000000000000 R12: ffff88809a018588
R13: dffffc0000000000 R14: ffff88809a01823c R15: 1ffff11013403047
FS:  0000000001eae940(0000) GS:ffff8880aeb00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004dcd48 CR3: 0000000092f8b000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/11 15:40 upstream 9805a68371ce dc438b91 .config console log report syz ci-upstream-kasan-gce-smack-root
2019/11/09 08:55 upstream 6737e7634951 dc438b91 .config console log report syz ci-upstream-kasan-gce-smack-root
2019/11/07 09:58 upstream 4dd58158254c d797d201 .config console log report syz ci-upstream-kasan-gce-smack-root
2019/11/04 23:13 upstream a99d8080aaf3 76630fc9 .config console log report syz ci-upstream-kasan-gce-smack-root
2019/11/17 01:54 upstream 6c9594bdd474 d5696d51 .config console log report ci-upstream-kasan-gce-smack-root
2019/11/14 07:28 upstream bf9294798930 048f2d49 .config console log report ci-upstream-kasan-gce-smack-root
2019/11/13 19:36 upstream 0e3f1ad80fc8 048f2d49 .config console log report ci-upstream-kasan-gce-smack-root
2019/11/09 19:01 upstream 0058b0a506e4 dc438b91 .config console log report ci-upstream-kasan-gce-smack-root
2019/11/09 08:36 upstream 6737e7634951 dc438b91 .config console log report ci-upstream-kasan-gce-smack-root
2019/11/09 04:57 upstream 6737e7634951 dc438b91 .config console log report ci-upstream-kasan-gce-smack-root
2019/11/04 22:56 upstream a99d8080aaf3 76630fc9 .config console log report ci-upstream-kasan-gce-smack-root
* Struck through repros no longer work on HEAD.