syzbot


KMSAN: uninit-value in can_receive (2)

Status: fixed on 2020/11/16 12:12
Subsystems: can
[Documentation on labels]
Reported-by: syzbot+3f3837e61a48d32b495f@syzkaller.appspotmail.com
Fix commit: e009f95b1543 can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt
First crash: 1412d, last: 1317d
Discussions (6)
Title Replies (including bot) Last reply
[PATCH 5.9 000/757] 5.9.2-rc1 review 766 (766) 2020/10/30 08:32
[PATCH 5.8 000/633] 5.8.17-rc1 review 638 (638) 2020/10/28 22:08
[PATCH 5.4 000/408] 5.4.73-rc1 review 410 (410) 2020/10/28 06:53
[Patch net] can: initialize skbcnt in j1939_tp_tx_dat_new() 6 (6) 2020/10/09 06:15
[PATCH 2/3] can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt 1 (1) 2020/10/08 21:40
KMSAN: uninit-value in can_receive (2) 0 (2) 2020/08/13 05:12
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: kernel-infoleak in _copy_to_iter (7) net C 138977 482d 835d 22/27 fixed on 2023/02/24 13:50
upstream KMSAN: uninit-value in can_receive can C 14 1587d 1676d 15/27 fixed on 2020/02/18 14:31
Last patch testing requests (2)
Created Duration User Patch Repo Result
2020/10/08 04:58 20m xiyou.wangcong@gmail.com patch https://github.com/google/kmsan.git master OK
2020/09/15 13:43 13m anant.thazhemadam@gmail.com https://github.com/google/kmsan.git master report log

Sample crash report:
=====================================================
BUG: KMSAN: uninit-value in can_receive+0x26b/0x630 net/can/af_can.c:650
CPU: 1 PID: 8475 Comm: syz-executor984 Not tainted 5.8.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x21c/0x280 lib/dump_stack.c:118
 kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:121
 __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215
 can_receive+0x26b/0x630 net/can/af_can.c:650
 can_rcv+0x1fb/0x410 net/can/af_can.c:686
 __netif_receive_skb_one_core net/core/dev.c:5281 [inline]
 __netif_receive_skb+0x265/0x670 net/core/dev.c:5395
 process_backlog+0x50d/0xba0 net/core/dev.c:6239
 napi_poll+0x43b/0xfd0 net/core/dev.c:6684
 net_rx_action+0x35c/0xd40 net/core/dev.c:6752
 __do_softirq+0x2ea/0x7f5 kernel/softirq.c:293
 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:711
 </IRQ>
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:23 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:50 [inline]
 do_softirq_own_stack+0x7c/0xa0 arch/x86/kernel/irq_64.c:77
 invoke_softirq kernel/softirq.c:390 [inline]
 __irq_exit_rcu+0x226/0x270 kernel/softirq.c:420
 irq_exit_rcu+0xe/0x10 kernel/softirq.c:432
 sysvec_apic_timer_interrupt+0x107/0x130 arch/x86/kernel/apic/apic.c:1091
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:593
RIP: 0010:_raw_spin_unlock_irqrestore+0x4b/0x70 kernel/locking/spinlock.c:192
Code: 00 8b b8 88 0c 00 00 48 8b 00 48 85 c0 75 28 48 89 df e8 b8 6e 4b f1 c6 00 00 c6 03 00 4d 85 e4 75 1c 4c 89 7d d8 ff 75 d8 9d <48> 83 c4 08 5b 41 5c 41 5e 41 5f 5d c3 e8 53 74 4b f1 eb d1 44 89
RSP: 0018:ffff8880b8b0f880 EFLAGS: 00000282
RAX: ffff88821fd3bc00 RBX: ffff88812fd1dc00 RCX: 000000021fc9cc00
RDX: ffff88821fc9cc00 RSI: 00000000000004a0 RDI: ffff88812fd1dc00
RBP: ffff8880b8b0f8a8 R08: ffffea000000000f R09: ffff88812fffa000
R10: 0000000000000004 R11: 0000000000000000 R12: 0000000000000000
R13: ffff8880b656c2e8 R14: 0000000000000000 R15: 0000000000000282
 unlock_hrtimer_base kernel/time/hrtimer.c:898 [inline]
 hrtimer_start_range_ns+0x459/0x4e0 kernel/time/hrtimer.c:1136
 hrtimer_start include/linux/hrtimer.h:421 [inline]
 j1939_tp_schedule_txtimer+0x132/0x1b0 net/can/j1939/transport.c:671
 j1939_sk_send_loop net/can/j1939/socket.c:1047 [inline]
 j1939_sk_sendmsg+0x1cc0/0x2950 net/can/j1939/socket.c:1160
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg net/socket.c:672 [inline]
 ____sys_sendmsg+0xc82/0x1240 net/socket.c:2352
 ___sys_sendmsg net/socket.c:2406 [inline]
 __sys_sendmsg+0x6d1/0x840 net/socket.c:2439
 __do_sys_sendmsg net/socket.c:2448 [inline]
 __se_sys_sendmsg+0x97/0xb0 net/socket.c:2446
 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2446
 do_syscall_64+0xad/0x160 arch/x86/entry/common.c:386
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x443559
Code: Bad RIP value.
RSP: 002b:00007ffffdad8558 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000443559
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003
RBP: 00007ffffdad8560 R08: 0000000001bbbbbb R09: 0000000001bbbbbb
R10: 0000000001bbbbbb R11: 0000000000000246 R12: 00007ffffdad8570
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:144 [inline]
 kmsan_internal_poison_shadow+0x66/0xd0 mm/kmsan/kmsan.c:127
 kmsan_slab_alloc+0x8a/0xe0 mm/kmsan/kmsan_hooks.c:80
 slab_alloc_node mm/slub.c:2839 [inline]
 __kmalloc_node_track_caller+0xeab/0x12e0 mm/slub.c:4478
 __kmalloc_reserve net/core/skbuff.c:142 [inline]
 __alloc_skb+0x35f/0xb30 net/core/skbuff.c:210
 alloc_skb include/linux/skbuff.h:1083 [inline]
 j1939_tp_tx_dat_new net/can/j1939/transport.c:568 [inline]
 j1939_xtp_do_tx_ctl net/can/j1939/transport.c:628 [inline]
 j1939_tp_tx_ctl net/can/j1939/transport.c:646 [inline]
 j1939_session_tx_rts net/can/j1939/transport.c:714 [inline]
 j1939_xtp_txnext_transmiter net/can/j1939/transport.c:832 [inline]
 j1939_tp_txtimer+0x402c/0x6980 net/can/j1939/transport.c:1095
 __run_hrtimer+0x7cd/0xf00 kernel/time/hrtimer.c:1520
 __hrtimer_run_queues kernel/time/hrtimer.c:1584 [inline]
 hrtimer_run_softirq+0x3bf/0x690 kernel/time/hrtimer.c:1601
 __do_softirq+0x2ea/0x7f5 kernel/softirq.c:293
=====================================================

Crashes (2060):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/13 05:11 https://github.com/google/kmsan.git master ce8056d1f79e bc15f7db .config console log report syz C ci-upstream-kmsan-gce
2020/10/19 19:57 https://github.com/google/kmsan.git master e67f4ba870c2 ff4a3345 .config console log report info ci-upstream-kmsan-gce
2020/10/19 03:07 https://github.com/google/kmsan.git master e67f4ba870c2 fea47c01 .config console log report info ci-upstream-kmsan-gce
2020/10/18 14:46 https://github.com/google/kmsan.git master e67f4ba870c2 fea47c01 .config console log report info ci-upstream-kmsan-gce
2020/10/18 10:39 https://github.com/google/kmsan.git master e67f4ba870c2 fea47c01 .config console log report info ci-upstream-kmsan-gce
2020/10/17 13:44 https://github.com/google/kmsan.git master e67f4ba870c2 fea47c01 .config console log report info ci-upstream-kmsan-gce
2020/10/17 11:29 https://github.com/google/kmsan.git master e67f4ba870c2 fea47c01 .config console log report info ci-upstream-kmsan-gce
2020/10/16 20:43 https://github.com/google/kmsan.git master e67f4ba870c2 6e262c73 .config console log report info ci-upstream-kmsan-gce
2020/10/16 18:20 https://github.com/google/kmsan.git master e67f4ba870c2 6e262c73 .config console log report info ci-upstream-kmsan-gce
2020/10/16 16:48 https://github.com/google/kmsan.git master e67f4ba870c2 6e262c73 .config console log report info ci-upstream-kmsan-gce
2020/10/16 12:54 https://github.com/google/kmsan.git master e67f4ba870c2 6e262c73 .config console log report info ci-upstream-kmsan-gce
2020/10/16 01:24 https://github.com/google/kmsan.git master e67f4ba870c2 6e262c73 .config console log report info ci-upstream-kmsan-gce
2020/10/16 00:23 https://github.com/google/kmsan.git master e67f4ba870c2 6e262c73 .config console log report info ci-upstream-kmsan-gce
2020/10/11 17:38 https://github.com/google/kmsan.git master e67f4ba870c2 4a77ae0b .config console log report info ci-upstream-kmsan-gce
2020/10/10 21:48 https://github.com/google/kmsan.git master e67f4ba870c2 4a77ae0b .config console log report info ci-upstream-kmsan-gce
2020/10/10 20:43 https://github.com/google/kmsan.git master e67f4ba870c2 4a77ae0b .config console log report info ci-upstream-kmsan-gce
2020/10/10 15:00 https://github.com/google/kmsan.git master e67f4ba870c2 93817d89 .config console log report info ci-upstream-kmsan-gce
2020/10/10 14:52 https://github.com/google/kmsan.git master e67f4ba870c2 93817d89 .config console log report info ci-upstream-kmsan-gce
2020/10/08 16:52 https://github.com/google/kmsan.git master 5edb1df295b9 92390980 .config console log report info ci-upstream-kmsan-gce
2020/11/12 06:47 https://github.com/google/kmsan.git master e16174226146 cca87986 .config console log report info ci-upstream-kmsan-gce-386
2020/11/11 13:13 https://github.com/google/kmsan.git master e16174226146 cca87986 .config console log report info ci-upstream-kmsan-gce-386
2020/11/11 08:57 https://github.com/google/kmsan.git master e16174226146 cca87986 .config console log report info ci-upstream-kmsan-gce-386
2020/11/10 23:08 https://github.com/google/kmsan.git master e16174226146 cca87986 .config console log report info ci-upstream-kmsan-gce-386
2020/11/10 08:14 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/10 07:04 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/07 17:59 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/07 12:59 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/07 05:07 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/06 02:49 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/05 20:50 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/05 20:35 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/05 17:03 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/05 12:12 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/05 08:58 https://github.com/google/kmsan.git master e16174226146 64069d48 .config console log report info ci-upstream-kmsan-gce-386
2020/11/03 18:15 https://github.com/google/kmsan.git master e16174226146 cba33199 .config console log report info ci-upstream-kmsan-gce-386
2020/11/03 18:07 https://github.com/google/kmsan.git master e16174226146 cba33199 .config console log report info ci-upstream-kmsan-gce-386
2020/11/03 14:33 https://github.com/google/kmsan.git master e16174226146 cba33199 .config console log report info ci-upstream-kmsan-gce-386
2020/11/03 01:03 https://github.com/google/kmsan.git master e16174226146 8bc4594f .config console log report info ci-upstream-kmsan-gce-386
2020/11/02 08:35 https://github.com/google/kmsan.git master e16174226146 8bc4594f .config console log report info ci-upstream-kmsan-gce-386
2020/11/02 07:02 https://github.com/google/kmsan.git master e16174226146 8bc4594f .config console log report info ci-upstream-kmsan-gce-386
2020/11/02 05:57 https://github.com/google/kmsan.git master e16174226146 8bc4594f .config console log report info ci-upstream-kmsan-gce-386
2020/11/02 04:50 https://github.com/google/kmsan.git master e16174226146 8bc4594f .config console log report info ci-upstream-kmsan-gce-386
2020/11/02 03:22 https://github.com/google/kmsan.git master e16174226146 8bc4594f .config console log report info ci-upstream-kmsan-gce-386
2020/11/02 00:15 https://github.com/google/kmsan.git master e16174226146 8bc4594f .config console log report info ci-upstream-kmsan-gce-386
2020/11/01 10:24 https://github.com/google/kmsan.git master e16174226146 8bc4594f .config console log report info ci-upstream-kmsan-gce-386
2020/10/29 14:57 https://github.com/google/kmsan.git master e16174226146 f24824d3 .config console log report info ci-upstream-kmsan-gce-386
2020/10/21 22:58 https://github.com/google/kmsan.git master e16174226146 99c64d5c .config console log report info ci-upstream-kmsan-gce-386
2020/10/21 20:09 https://github.com/google/kmsan.git master e16174226146 99c64d5c .config console log report info ci-upstream-kmsan-gce-386
2020/08/09 05:53 https://github.com/google/kmsan.git master ce8056d1f79e f721e4a0 .config console log report ci-upstream-kmsan-gce-386
2020/08/09 05:15 https://github.com/google/kmsan.git master ce8056d1f79e f721e4a0 .config console log report ci-upstream-kmsan-gce-386
* Struck through repros no longer work on HEAD.