syzbot


KMSAN: uninit-value in idmouse_open

Status: fixed on 2023/02/24 13:50
Subsystems: usb
[Documentation on labels]
Reported-by: syzbot+79832d33eb89fb3cd092@syzkaller.appspotmail.com
Fix commit: bce2b0539933 usb: idmouse: fix an uninit-value in idmouse_open
First crash: 1336d, last: 579d
Discussions (18)
Title Replies (including bot) Last reply
[PATCH 5.15 000/530] 5.15.75-rc1 review 542 (542) 2023/01/10 15:19
[PATCH 5.4 000/255] 5.4.220-rc1 review 276 (276) 2022/11/01 17:29
[PATCH 4.19 000/229] 4.19.262-rc1 review 242 (242) 2022/11/01 13:44
[PATCH 4.9 000/159] 4.9.331-rc1 review 165 (165) 2022/10/25 17:41
[PATCH 4.14 000/210] 4.14.296-rc1 review 213 (213) 2022/10/25 17:38
[PATCH 5.10 000/390] 5.10.150-rc1 review 407 (407) 2022/10/25 15:12
[PATCH 5.19 000/717] 5.19.17-rc1 review 732 (732) 2022/10/24 19:01
[PATCH 6.0 000/862] 6.0.3-rc1 review 899 (899) 2022/10/21 09:08
[PATCH AUTOSEL 5.10 01/33] clk: zynqmp: Fix stack-out-of-bounds in strncpy` 34 (34) 2022/10/18 09:48
[PATCH AUTOSEL 4.9 01/10] media: cx88: Fix a null-ptr-deref bug in buffer_prepare() 14 (14) 2022/10/17 14:57
[PATCH AUTOSEL 5.19 01/63] staging: r8188eu: do not spam the kernel log 72 (72) 2022/10/16 14:57
[PATCH AUTOSEL 5.15 01/47] clk: zynqmp: Fix stack-out-of-bounds in strncpy` 52 (52) 2022/10/16 13:30
[PATCH AUTOSEL 6.0 01/67] staging: r8188eu: do not spam the kernel log 72 (72) 2022/10/13 18:40
[PATCH AUTOSEL 5.4 01/27] clk: zynqmp: Fix stack-out-of-bounds in strncpy` 30 (30) 2022/10/13 17:51
[PATCH AUTOSEL 4.14 01/13] media: cx88: Fix a null-ptr-deref bug in buffer_prepare() 14 (14) 2022/10/13 05:54
[PATCH AUTOSEL 4.19 01/19] media: cx88: Fix a null-ptr-deref bug in buffer_prepare() 19 (19) 2022/10/13 00:26
[syzbot] KMSAN: uninit-value in idmouse_open 6 (13) 2022/09/29 12:42
[PATCH] usb: idmouse: fix an uninit-value in idmouse_open 1 (1) 2022/09/22 13:48
Last patch testing requests (5)
Created Duration User Patch Repo Result
2022/09/29 12:20 7m oneukum@suse.com patch https://github.com/google/kmsan.git master error OK
2022/09/29 12:13 7m glider@google.com patch https://github.com/google/kmsan.git master error OK
2022/09/29 11:43 7m oneukum@suse.com patch https://github.com/google/kmsan.git master error OK
2022/09/29 09:42 0m oneukum@suse.com patch https://github.com/google/kmsan.git ce8056d1f79e error OK
2022/09/14 18:29 13m retest repro https://github.com/google/kmsan.git master report log

Sample crash report:
=====================================================
BUG: KMSAN: uninit-value in idmouse_create_image drivers/usb/misc/idmouse.c:187 [inline]
BUG: KMSAN: uninit-value in idmouse_open+0x12da/0x1780 drivers/usb/misc/idmouse.c:249
CPU: 0 PID: 8474 Comm: syz-executor157 Not tainted 5.8.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __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
 idmouse_create_image drivers/usb/misc/idmouse.c:187 [inline]
 idmouse_open+0x12da/0x1780 drivers/usb/misc/idmouse.c:249
 usb_open+0x27f/0x400 drivers/usb/core/file.c:48
 chrdev_open+0xc7c/0xe10 fs/char_dev.c:414
 do_dentry_open+0x12bc/0x1d30 fs/open.c:828
 vfs_open+0xaf/0xe0 fs/open.c:942
 do_open fs/namei.c:3243 [inline]
 path_openat+0x542b/0x6ba0 fs/namei.c:3360
 do_filp_open+0x2b8/0x710 fs/namei.c:3387
 do_sys_openat2+0xa6a/0x1020 fs/open.c:1179
 do_sys_open fs/open.c:1195 [inline]
 ksys_open include/linux/syscalls.h:1388 [inline]
 __do_sys_open fs/open.c:1201 [inline]
 __se_sys_open+0x270/0x2d0 fs/open.c:1199
 __x64_sys_open+0x4a/0x70 fs/open.c:1199
 do_syscall_64+0xad/0x160 arch/x86/entry/common.c:386
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x401470
Code: Bad RIP value.
RSP: 002b:00007ffe8619e918 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00000000004002e0 RCX: 0000000000401470
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 00007ffe8619e930
RBP: 00000000006cf018 R08: 0000000000000000 R09: 000000000000000f
R10: 0000000000000064 R11: 0000000000000246 R12: 00000000004023d0
R13: 0000000000402460 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
 kmsan_save_stack_with_flags+0x3c/0x90 mm/kmsan/kmsan.c:144
 kmsan_internal_alloc_meta_for_pages mm/kmsan/kmsan_shadow.c:269 [inline]
 kmsan_alloc_page+0xc5/0x1a0 mm/kmsan/kmsan_shadow.c:293
 __alloc_pages_nodemask+0xdf0/0x1030 mm/page_alloc.c:4889
 alloc_pages_current+0x685/0xb50 mm/mempolicy.c:2292
 alloc_pages include/linux/gfp.h:545 [inline]
 kmalloc_order mm/slab_common.c:1325 [inline]
 kmalloc_order_trace+0x92/0x3d0 mm/slab_common.c:1341
 kmalloc_large include/linux/slab.h:484 [inline]
 kmalloc include/linux/slab.h:548 [inline]
 idmouse_probe+0x48c/0xa60 drivers/usb/misc/idmouse.c:352
 usb_probe_interface+0xece/0x1550 drivers/usb/core/driver.c:374
 really_probe+0xf20/0x20b0 drivers/base/dd.c:529
 driver_probe_device+0x293/0x390 drivers/base/dd.c:701
 __device_attach_driver+0x63f/0x830 drivers/base/dd.c:807
 bus_for_each_drv+0x2ca/0x3f0 drivers/base/bus.c:431
 __device_attach+0x4e2/0x7f0 drivers/base/dd.c:873
 device_initial_probe+0x4a/0x60 drivers/base/dd.c:920
 bus_probe_device+0x177/0x3d0 drivers/base/bus.c:491
 device_add+0x3b0e/0x40d0 drivers/base/core.c:2680
 usb_set_configuration+0x380f/0x3f10 drivers/usb/core/message.c:2032
 usb_generic_driver_probe+0x138/0x300 drivers/usb/core/generic.c:241
 usb_probe_device+0x311/0x490 drivers/usb/core/driver.c:272
 really_probe+0xf20/0x20b0 drivers/base/dd.c:529
 driver_probe_device+0x293/0x390 drivers/base/dd.c:701
 __device_attach_driver+0x63f/0x830 drivers/base/dd.c:807
 bus_for_each_drv+0x2ca/0x3f0 drivers/base/bus.c:431
 __device_attach+0x4e2/0x7f0 drivers/base/dd.c:873
 device_initial_probe+0x4a/0x60 drivers/base/dd.c:920
 bus_probe_device+0x177/0x3d0 drivers/base/bus.c:491
 device_add+0x3b0e/0x40d0 drivers/base/core.c:2680
 usb_new_device+0x1bd4/0x2a30 drivers/usb/core/hub.c:2554
 hub_port_connect drivers/usb/core/hub.c:5208 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5348 [inline]
 port_event drivers/usb/core/hub.c:5494 [inline]
 hub_event+0x5e7b/0x8a70 drivers/usb/core/hub.c:5576
 process_one_work+0x1688/0x2140 kernel/workqueue.c:2269
 worker_thread+0x10bc/0x2730 kernel/workqueue.c:2415
 kthread+0x551/0x590 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293
=====================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/25 19:59 https://github.com/google/kmsan.git master ce8056d1f79e 344da168 .config console log report syz C ci-upstream-kmsan-gce
2020/08/19 06:38 https://github.com/google/kmsan.git master ce8056d1f79e e1c29030 .config console log report syz C ci-upstream-kmsan-gce
2020/08/23 16:19 https://github.com/google/kmsan.git master ce8056d1f79e cef5ae68 .config console log report ci-upstream-kmsan-gce
2020/08/19 05:28 https://github.com/google/kmsan.git master ce8056d1f79e e1c29030 .config console log report ci-upstream-kmsan-gce
2020/08/19 05:04 https://github.com/google/kmsan.git master ce8056d1f79e e1c29030 .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.