syzbot


WARNING in nci_add_new_protocol

Status: fixed on 2023/02/24 13:50
Subsystems: net nfc
[Documentation on labels]
Reported-by: syzbot+210e196cef4711b65139@syzkaller.appspotmail.com
Fix commit: e329e71013c9 NFC: nci: Bounds check struct nfc_target arrays
First crash: 743d, last: 743d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] NFC: nci: Bounds check struct nfc_target arrays 3 (3) 2022/12/06 05:00
[syzbot] WARNING in nci_add_new_protocol 2 (3) 2022/12/05 07:57

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 7843 at net/nfc/nci/ntf.c:260 nci_add_new_protocol+0x268/0x30c net/nfc/nci/ntf.c:260
memcpy: detected field-spanning write (size 129) of single field "target->sensf_res" at net/nfc/nci/ntf.c:260 (size 18)
Modules linked in:
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 7843 Comm: kworker/u4:3 Not tainted 6.1.0-rc6-syzkaller #0
Hardware name: ARM-Versatile Express
Workqueue: nfc2_nci_rx_wq nci_rx_work
Backtrace: 
[<81751624>] (dump_backtrace) from [<81751718>] (show_stack+0x18/0x1c arch/arm/kernel/traps.c:253)
 r7:81cf8970 r6:822228ec r5:60000193 r4:81d06d58
[<81751700>] (show_stack) from [<8176d3e0>] (__dump_stack lib/dump_stack.c:88 [inline])
[<81751700>] (show_stack) from [<8176d3e0>] (dump_stack_lvl+0x48/0x54 lib/dump_stack.c:106)
[<8176d398>] (dump_stack_lvl) from [<8176d404>] (dump_stack+0x18/0x1c lib/dump_stack.c:113)
 r5:00000000 r4:82445d14
[<8176d3ec>] (dump_stack) from [<817522c0>] (panic+0x11c/0x360 kernel/panic.c:274)
[<817521a4>] (panic) from [<80241604>] (__warn+0x98/0x1a4 kernel/panic.c:621)
 r3:00000001 r2:00000000 r1:00000000 r0:81cf8970
 r7:816e192c
[<8024156c>] (__warn) from [<817525a0>] (warn_slowpath_fmt+0x9c/0xd4 kernel/panic.c:651)
 r8:00000009 r7:816e192c r6:00000104 r5:81ec7084 r4:81d20104
[<81752508>] (warn_slowpath_fmt) from [<816e192c>] (nci_add_new_protocol+0x268/0x30c net/nfc/nci/ntf.c:260)
 r8:84f0b129 r7:dfb25e4c r6:00000002 r5:00000081 r4:84f0b0fc
[<816e16c4>] (nci_add_new_protocol) from [<816e2738>] (nci_add_new_target net/nfc/nci/ntf.c:306 [inline])
[<816e16c4>] (nci_add_new_protocol) from [<816e2738>] (nci_rf_discover_ntf_packet net/nfc/nci/ntf.c:378 [inline])
[<816e16c4>] (nci_add_new_protocol) from [<816e2738>] (nci_ntf_packet+0xaf8/0xe18 net/nfc/nci/ntf.c:792)
 r8:00000001 r7:00000000 r6:84f0b000 r5:85202c00 r4:00000103
[<816e1c40>] (nci_ntf_packet) from [<816df268>] (nci_rx_work+0x70/0xe8 net/nfc/nci/core.c:1513)
 r10:84851205 r9:81a4b84c r8:81ec67b8 r7:84f0b0a4 r6:84f0b070 r5:84f0b000
 r4:85202c00
[<816df1f8>] (nci_rx_work) from [<802611c0>] (process_one_work+0x20c/0x5ac kernel/workqueue.c:2289)
 r9:828e5c00 r8:00000100 r7:84851200 r6:8280e800 r5:85867500 r4:84f0b070
[<80260fb4>] (process_one_work) from [<802615cc>] (worker_thread+0x6c/0x4e0 kernel/workqueue.c:2436)
 r10:8280e800 r9:00000088 r8:82204d40 r7:8280e81c r6:85867518 r5:8280e800
 r4:85867500
[<80261560>] (worker_thread) from [<80269b24>] (kthread+0xec/0x11c kernel/kthread.c:376)
 r10:00000000 r9:ed855e8c r8:852e8700 r7:85867500 r6:80261560 r5:828e5c00
 r4:84991a40
[<80269a38>] (kthread) from [<80200100>] (ret_from_fork+0x14/0x34 arch/arm/kernel/entry-common.S:148)
Exception stack(0xdfb25fb0 to 0xdfb25ff8)
5fa0:                                     00000000 00000000 00000000 00000000
5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:80269a38 r4:84991a40
Rebooting in 86400 seconds..

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/23 22:24 upstream 4312098baf37 52fdf57a .config console log report info ci-qemu2-arm32 WARNING in nci_add_new_protocol
* Struck through repros no longer work on HEAD.