syzbot


KMSAN: uninit-value in sd_init

Status: fixed on 2019/10/15 23:40
Subsystems: media usb
[Documentation on labels]
Reported-by: syzbot+1a35278dd0ebfb3a038a@syzkaller.appspotmail.com
Fix commit: 4843a543fad3 media: gspca: zero usb_buf on error
First crash: 1952d, last: 1818d
Discussions (20)
Title Replies (including bot) Last reply
[PATCH 5.2 000/313] 5.2.19-stable review 324 (324) 2020/06/23 22:07
[PATCH 4.19 000/211] 4.19.77-stable review 227 (227) 2019/11/12 00:25
[PATCH 5.3 000/344] 5.3.4-stable review 360 (360) 2019/11/11 06:01
[PATCH 4.14 000/185] 4.14.147-stable review 191 (191) 2019/10/05 00:10
[PATCH 4.9 000/129] 4.9.195-stable review 135 (135) 2019/10/04 22:56
[PATCH 4.4 00/99] 4.4.195-stable review 105 (105) 2019/10/04 22:55
[PATCH AUTOSEL 5.2 001/185] ALSA: hda: Flush interrupts on disabling 191 (191) 2019/10/02 19:16
[PATCH AUTOSEL 5.3 001/203] ALSA: hda: Flush interrupts on disabling 217 (217) 2019/10/02 14:35
[PATCH AUTOSEL 4.4 01/44] ALSA: hda: Flush interrupts on disabling 44 (44) 2019/09/22 19:01
[PATCH AUTOSEL 4.9 01/60] ALSA: hda: Flush interrupts on disabling 60 (60) 2019/09/22 18:59
[PATCH AUTOSEL 4.14 01/89] ALSA: hda: Flush interrupts on disabling 89 (89) 2019/09/22 18:57
[PATCH AUTOSEL 4.19 001/128] ALSA: hda: Flush interrupts on disabling 128 (128) 2019/09/22 18:54
[PATCHv2] gspca: zero usb_buf on error 1 (1) 2019/08/16 06:38
[PATCH] gspca: zero usb_buf on error 3 (3) 2019/08/16 05:48
Reminder: 35 open syzbot bugs in media subsystem 1 (1) 2019/07/24 01:39
Reminder: 67 open syzbot bugs in usb subsystem 1 (1) 2019/07/24 01:35
Reminder: 47 open syzbot bugs in usb subsystem 1 (1) 2019/07/09 19:01
Reminder: 28 open syzbot bugs in media subsystem 1 (1) 2019/06/27 03:53
Reminder: 42 open syzbot bugs in usb subsystem 1 (1) 2019/06/25 03:44
KMSAN: uninit-value in sd_init 0 (1) 2019/06/05 00:12
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: uninit-value in sd_init (2) media usb C 94 1798d 1794d 15/28 fixed on 2020/02/18 14:31
Last patch testing requests (2)
Created Duration User Patch Repo Result
2019/08/15 08:26 21m hverkuil@xs4all.nl patch https://github.com/google/kmsan.git master OK
2019/08/15 07:42 20m hverkuil@xs4all.nl patch https://github.com/google/kmsan.git master OK

Sample crash report:
usb 1-1: config 0 has an invalid interface number: 142 but max is 0
usb 1-1: config 0 has no interface number 0
usb 1-1: New USB device found, idVendor=08ca, idProduct=2018, bcdDevice=95.4a
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 1-1: config 0 descriptor??
gspca_main: sunplus-2.14.0 probing 08ca:2018
gspca_sunplus: reg_w_riv err -71
==================================================================
BUG: KMSAN: uninit-value in spca504B_PollingDataReady drivers/media/usb/gspca/sunplus.c:409 [inline]
BUG: KMSAN: uninit-value in sd_init+0x5b6f/0x5e60 drivers/media/usb/gspca/sunplus.c:643
CPU: 0 PID: 3902 Comm: kworker/0:2 Not tainted 5.1.0+ #1
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x191/0x1f0 lib/dump_stack.c:113
 kmsan_report+0x130/0x2a0 mm/kmsan/kmsan.c:622
 __msan_warning+0x75/0xe0 mm/kmsan/kmsan_instr.c:310
 spca504B_PollingDataReady drivers/media/usb/gspca/sunplus.c:409 [inline]
 sd_init+0x5b6f/0x5e60 drivers/media/usb/gspca/sunplus.c:643
 gspca_dev_probe2+0xee0/0x2240 drivers/media/usb/gspca/gspca.c:1546
 gspca_dev_probe+0x346/0x3b0 drivers/media/usb/gspca/gspca.c:1619
 sd_probe+0x8d/0xa0 drivers/media/usb/gspca/gl860/gl860.c:523
 usb_probe_interface+0xd66/0x1320 drivers/usb/core/driver.c:361
 really_probe+0xdae/0x1d80 drivers/base/dd.c:513
 driver_probe_device+0x1b3/0x4f0 drivers/base/dd.c:671
 __device_attach_driver+0x5b8/0x790 drivers/base/dd.c:778
 bus_for_each_drv+0x28e/0x3b0 drivers/base/bus.c:454
 __device_attach+0x454/0x730 drivers/base/dd.c:844
 device_initial_probe+0x4a/0x60 drivers/base/dd.c:891
 bus_probe_device+0x137/0x390 drivers/base/bus.c:514
 device_add+0x288d/0x30e0 drivers/base/core.c:2106
 usb_set_configuration+0x30dc/0x3750 drivers/usb/core/message.c:2027
 generic_probe+0xe7/0x280 drivers/usb/core/generic.c:210
 usb_probe_device+0x14c/0x200 drivers/usb/core/driver.c:266
 really_probe+0xdae/0x1d80 drivers/base/dd.c:513
 driver_probe_device+0x1b3/0x4f0 drivers/base/dd.c:671
 __device_attach_driver+0x5b8/0x790 drivers/base/dd.c:778
 bus_for_each_drv+0x28e/0x3b0 drivers/base/bus.c:454
 __device_attach+0x454/0x730 drivers/base/dd.c:844
 device_initial_probe+0x4a/0x60 drivers/base/dd.c:891
 bus_probe_device+0x137/0x390 drivers/base/bus.c:514
 device_add+0x288d/0x30e0 drivers/base/core.c:2106
 usb_new_device+0x23e5/0x2ff0 drivers/usb/core/hub.c:2534
 hub_port_connect drivers/usb/core/hub.c:5089 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5204 [inline]
 port_event drivers/usb/core/hub.c:5350 [inline]
 hub_event+0x48d1/0x7290 drivers/usb/core/hub.c:5432
 process_one_work+0x1572/0x1f00 kernel/workqueue.c:2269
 worker_thread+0x111b/0x2460 kernel/workqueue.c:2415
 kthread+0x4b5/0x4f0 kernel/kthread.c:254
 ret_from_fork+0x35/0x40 arch/x86/entry/entry_64.S:355

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:208 [inline]
 kmsan_internal_poison_shadow+0x92/0x150 mm/kmsan/kmsan.c:162
 kmsan_kmalloc+0xa4/0x130 mm/kmsan/kmsan_hooks.c:175
 kmem_cache_alloc_trace+0x503/0xae0 mm/slub.c:2801
 kmalloc include/linux/slab.h:547 [inline]
 gspca_dev_probe2+0x30c/0x2240 drivers/media/usb/gspca/gspca.c:1480
 gspca_dev_probe+0x346/0x3b0 drivers/media/usb/gspca/gspca.c:1619
 sd_probe+0x8d/0xa0 drivers/media/usb/gspca/gl860/gl860.c:523
 usb_probe_interface+0xd66/0x1320 drivers/usb/core/driver.c:361
 really_probe+0xdae/0x1d80 drivers/base/dd.c:513
 driver_probe_device+0x1b3/0x4f0 drivers/base/dd.c:671
 __device_attach_driver+0x5b8/0x790 drivers/base/dd.c:778
 bus_for_each_drv+0x28e/0x3b0 drivers/base/bus.c:454
 __device_attach+0x454/0x730 drivers/base/dd.c:844
 device_initial_probe+0x4a/0x60 drivers/base/dd.c:891
 bus_probe_device+0x137/0x390 drivers/base/bus.c:514
 device_add+0x288d/0x30e0 drivers/base/core.c:2106
 usb_set_configuration+0x30dc/0x3750 drivers/usb/core/message.c:2027
 generic_probe+0xe7/0x280 drivers/usb/core/generic.c:210
 usb_probe_device+0x14c/0x200 drivers/usb/core/driver.c:266
 really_probe+0xdae/0x1d80 drivers/base/dd.c:513
 driver_probe_device+0x1b3/0x4f0 drivers/base/dd.c:671
 __device_attach_driver+0x5b8/0x790 drivers/base/dd.c:778
 bus_for_each_drv+0x28e/0x3b0 drivers/base/bus.c:454
 __device_attach+0x454/0x730 drivers/base/dd.c:844
 device_initial_probe+0x4a/0x60 drivers/base/dd.c:891
 bus_probe_device+0x137/0x390 drivers/base/bus.c:514
 device_add+0x288d/0x30e0 drivers/base/core.c:2106
 usb_new_device+0x23e5/0x2ff0 drivers/usb/core/hub.c:2534
 hub_port_connect drivers/usb/core/hub.c:5089 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5204 [inline]
 port_event drivers/usb/core/hub.c:5350 [inline]
 hub_event+0x48d1/0x7290 drivers/usb/core/hub.c:5432
 process_one_work+0x1572/0x1f00 kernel/workqueue.c:2269
 worker_thread+0x111b/0x2460 kernel/workqueue.c:2415
 kthread+0x4b5/0x4f0 kernel/kthread.c:254
 ret_from_fork+0x35/0x40 arch/x86/entry/entry_64.S:355
==================================================================

Crashes (122):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/03 17:52 https://github.com/google/kmsan.git master f75e4cfea97f 63bf051f .config console log report syz C ci-upstream-kmsan-gce
2019/10/15 18:18 https://github.com/google/kmsan.git master c24534505750 b5268b89 .config console log report ci-upstream-kmsan-gce
2019/10/15 15:54 https://github.com/google/kmsan.git master c24534505750 b5268b89 .config console log report ci-upstream-kmsan-gce
2019/10/15 14:54 https://github.com/google/kmsan.git master c24534505750 b5268b89 .config console log report ci-upstream-kmsan-gce
2019/10/15 13:07 https://github.com/google/kmsan.git master c24534505750 b5268b89 .config console log report ci-upstream-kmsan-gce
2019/10/15 08:26 https://github.com/google/kmsan.git master c24534505750 05ad7292 .config console log report ci-upstream-kmsan-gce
2019/10/15 07:11 https://github.com/google/kmsan.git master c24534505750 05ad7292 .config console log report ci-upstream-kmsan-gce
2019/10/15 03:57 https://github.com/google/kmsan.git master c24534505750 05ad7292 .config console log report ci-upstream-kmsan-gce
2019/10/14 23:46 https://github.com/google/kmsan.git master c24534505750 05ad7292 .config console log report ci-upstream-kmsan-gce
2019/10/14 07:43 https://github.com/google/kmsan.git master fa1690255288 2f661ec4 .config console log report ci-upstream-kmsan-gce
2019/10/14 05:50 https://github.com/google/kmsan.git master fa1690255288 2f661ec4 .config console log report ci-upstream-kmsan-gce
2019/10/14 04:07 https://github.com/google/kmsan.git master fa1690255288 2f661ec4 .config console log report ci-upstream-kmsan-gce
2019/10/14 01:43 https://github.com/google/kmsan.git master fa1690255288 2f661ec4 .config console log report ci-upstream-kmsan-gce
2019/10/13 18:53 https://github.com/google/kmsan.git master fa1690255288 2f661ec4 .config console log report ci-upstream-kmsan-gce
2019/10/13 07:55 https://github.com/google/kmsan.git master fa1690255288 426631dd .config console log report ci-upstream-kmsan-gce
2019/10/12 21:46 https://github.com/google/kmsan.git master fa1690255288 426631dd .config console log report ci-upstream-kmsan-gce
2019/10/12 14:46 https://github.com/google/kmsan.git master fa1690255288 426631dd .config console log report ci-upstream-kmsan-gce
2019/10/12 13:21 https://github.com/google/kmsan.git master fa1690255288 426631dd .config console log report ci-upstream-kmsan-gce
2019/10/11 17:22 https://github.com/google/kmsan.git master dde8031634c3 1a3bad90 .config console log report ci-upstream-kmsan-gce
2019/10/11 12:07 https://github.com/google/kmsan.git master c38191cb7026 1a3bad90 .config console log report ci-upstream-kmsan-gce
2019/10/11 09:32 https://github.com/google/kmsan.git master c38191cb7026 1a3bad90 .config console log report ci-upstream-kmsan-gce
2019/10/11 07:44 https://github.com/google/kmsan.git master c38191cb7026 1a3bad90 .config console log report ci-upstream-kmsan-gce
2019/10/10 19:23 https://github.com/google/kmsan.git master c38191cb7026 a4efa8c0 .config console log report ci-upstream-kmsan-gce
2019/10/10 16:04 https://github.com/google/kmsan.git master c38191cb7026 a4efa8c0 .config console log report ci-upstream-kmsan-gce
2019/10/10 06:53 https://github.com/google/kmsan.git master dc327ecad3b0 c4b9981b .config console log report ci-upstream-kmsan-gce
2019/10/10 05:21 https://github.com/google/kmsan.git master dc327ecad3b0 c4b9981b .config console log report ci-upstream-kmsan-gce
2019/10/09 01:10 https://github.com/google/kmsan.git master cebb918b7474 b1ebbfef .config console log report ci-upstream-kmsan-gce
2019/10/08 18:01 https://github.com/google/kmsan.git master cebb918b7474 b1ebbfef .config console log report ci-upstream-kmsan-gce
2019/10/08 12:10 https://github.com/google/kmsan.git master cebb918b7474 28ac6e64 .config console log report ci-upstream-kmsan-gce
2019/10/08 10:42 https://github.com/google/kmsan.git master cebb918b7474 28ac6e64 .config console log report ci-upstream-kmsan-gce
2019/10/07 08:24 https://github.com/google/kmsan.git master 1e76a3e537c3 f3f7d9c8 .config console log report ci-upstream-kmsan-gce
2019/10/06 22:49 https://github.com/google/kmsan.git master 1e76a3e537c3 f3f7d9c8 .config console log report ci-upstream-kmsan-gce
2019/10/06 19:13 https://github.com/google/kmsan.git master 1e76a3e537c3 f3f7d9c8 .config console log report ci-upstream-kmsan-gce
2019/10/06 16:30 https://github.com/google/kmsan.git master 1e76a3e537c3 f3f7d9c8 .config console log report ci-upstream-kmsan-gce
2019/10/06 03:08 https://github.com/google/kmsan.git master 1e76a3e537c3 f3f7d9c8 .config console log report ci-upstream-kmsan-gce
2019/10/05 18:52 https://github.com/google/kmsan.git master 1e76a3e537c3 f3f7d9c8 .config console log report ci-upstream-kmsan-gce
2019/10/05 04:18 https://github.com/google/kmsan.git master 1e76a3e537c3 f3f7d9c8 .config console log report ci-upstream-kmsan-gce
2019/10/04 15:33 https://github.com/google/kmsan.git master 1e76a3e537c3 b2f369e5 .config console log report ci-upstream-kmsan-gce
2019/10/04 14:31 https://github.com/google/kmsan.git master 1e76a3e537c3 b2f369e5 .config console log report ci-upstream-kmsan-gce
2019/10/03 17:41 https://github.com/google/kmsan.git master 1e76a3e537c3 fc17ba49 .config console log report ci-upstream-kmsan-gce
2019/10/03 08:21 https://github.com/google/kmsan.git master 1e76a3e537c3 2e29b534 .config console log report ci-upstream-kmsan-gce
2019/10/03 07:09 https://github.com/google/kmsan.git master 1e76a3e537c3 2e29b534 .config console log report ci-upstream-kmsan-gce
2019/10/03 03:54 https://github.com/google/kmsan.git master 1e76a3e537c3 2e29b534 .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.