syzbot


KMSAN: kernel-infoleak in video_usercopy

Status: fixed on 2019/03/28 12:00
Subsystems: media
[Documentation on labels]
Reported-by: syzbot+4f021cf3697781dbd9fb@syzkaller.appspotmail.com
Fix commit: f45f3f753b0a media: v4l2-ctrls.c/uvc: zero v4l2_event
First crash: 1999d, last: 1888d
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 4.4 000/131] 4.4.178-stable review 144 (144) 2019/04/03 13:40
[PATCH 3.18 00/50] 3.18.138-stable review 54 (54) 2019/04/03 00:05
[PATCH 4.9 00/30] 4.9.166-stable review 38 (38) 2019/04/01 11:46
[PATCH 5.0 00/52] 5.0.5-stable review 61 (61) 2019/03/27 05:06
[PATCH 4.19 00/45] 4.19.32-stable review 51 (51) 2019/03/27 04:04
[PATCH 4.14 00/41] 4.14.109-stable review 47 (47) 2019/03/26 23:15
[PATCH] v4l2-ctrls.c/uvc: zero v4l2_event 2 (2) 2018/12/18 22:03
KMSAN: kernel-infoleak in video_usercopy 0 (1) 2018/12/18 12:41
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: kernel-infoleak in video_usercopy (2) media C 922 1353d 1558d 0/26 auto-obsoleted due to no activity on 2022/09/16 08:29

Sample crash report:
==================================================================
BUG: KMSAN: kernel-infoleak in _copy_to_user+0x1a4/0x250 lib/usercopy.c:32
CPU: 0 PID: 6254 Comm: syz-executor456 Not tainted 4.20.0-rc5+ #2
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+0x1c9/0x220 lib/dump_stack.c:113
 kmsan_report+0x12d/0x290 mm/kmsan/kmsan.c:682
 kmsan_internal_check_memory+0x334/0xa60 mm/kmsan/kmsan.c:742
 kmsan_copy_to_user+0x8d/0xa0 mm/kmsan/kmsan_hooks.c:604
 _copy_to_user+0x1a4/0x250 lib/usercopy.c:32
 copy_to_user include/linux/uaccess.h:177 [inline]
 video_usercopy+0x16c9/0x17d0 drivers/media/v4l2-core/v4l2-ioctl.c:3066
 video_ioctl2+0x9f/0xb0 drivers/media/v4l2-core/v4l2-ioctl.c:3079
 v4l2_ioctl+0x23f/0x270 drivers/media/v4l2-core/v4l2-dev.c:364
 do_vfs_ioctl+0xf36/0x2d30 fs/ioctl.c:46
 ksys_ioctl fs/ioctl.c:713 [inline]
 __do_sys_ioctl fs/ioctl.c:720 [inline]
 __se_sys_ioctl+0x1da/0x270 fs/ioctl.c:718
 __x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:718
 do_syscall_64+0xcd/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7
RIP: 0033:0x445659
Code: e8 6c b6 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 2b 12 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ff7a472ada8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000006dac28 RCX: 0000000000445659
RDX: 0000000020000000 RSI: 0000000080885659 RDI: 0000000000000003
RBP: 00000000006dac20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dac2c
R13: 6469762f7665642f R14: 00007ff7a472b9c0 R15: 00000000006dad2c

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:247 [inline]
 kmsan_save_stack mm/kmsan/kmsan.c:262 [inline]
 kmsan_internal_chain_origin+0x162/0x260 mm/kmsan/kmsan.c:470
 kmsan_memcpy_memmove_metadata+0x1a9/0xf30 mm/kmsan/kmsan.c:345
 kmsan_memcpy_metadata+0xb/0x10 mm/kmsan/kmsan.c:363
 __msan_memcpy+0x61/0x70 mm/kmsan/kmsan_instr.c:148
 __v4l2_event_dequeue+0x2f8/0x730 drivers/media/v4l2-core/v4l2-event.c:54
 v4l2_event_dequeue+0x41c/0x560 drivers/media/v4l2-core/v4l2-event.c:81
 v4l_dqevent+0xba/0xe0 drivers/media/v4l2-core/v4l2-ioctl.c:2427
 __video_do_ioctl+0x1975/0x1fc0 drivers/media/v4l2-core/v4l2-ioctl.c:2853
 video_usercopy+0x8ae/0x17d0 drivers/media/v4l2-core/v4l2-ioctl.c:3035
 video_ioctl2+0x9f/0xb0 drivers/media/v4l2-core/v4l2-ioctl.c:3079
 v4l2_ioctl+0x23f/0x270 drivers/media/v4l2-core/v4l2-dev.c:364
 do_vfs_ioctl+0xf36/0x2d30 fs/ioctl.c:46
 ksys_ioctl fs/ioctl.c:713 [inline]
 __do_sys_ioctl fs/ioctl.c:720 [inline]
 __se_sys_ioctl+0x1da/0x270 fs/ioctl.c:718
 __x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:718
 do_syscall_64+0xcd/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:247 [inline]
 kmsan_save_stack mm/kmsan/kmsan.c:262 [inline]
 kmsan_internal_chain_origin+0x162/0x260 mm/kmsan/kmsan.c:470
 kmsan_memcpy_memmove_metadata+0x1a9/0xf30 mm/kmsan/kmsan.c:345
 kmsan_memcpy_metadata+0xb/0x10 mm/kmsan/kmsan.c:363
 __msan_memcpy+0x61/0x70 mm/kmsan/kmsan_instr.c:148
 __v4l2_event_queue_fh+0xd2d/0x1260 drivers/media/v4l2-core/v4l2-event.c:145
 v4l2_event_queue_fh+0x1a1/0x270 drivers/media/v4l2-core/v4l2-event.c:185
 v4l2_ctrl_add_event+0x952/0xc20 drivers/media/v4l2-core/v4l2-ctrls.c:4099
 v4l2_event_subscribe+0xf75/0x1240 drivers/media/v4l2-core/v4l2-event.c:251
 v4l2_ctrl_subscribe_event+0xb6/0x110 drivers/media/v4l2-core/v4l2-ctrls.c:4156
 v4l_subscribe_event+0x9e/0xc0 drivers/media/v4l2-core/v4l2-ioctl.c:2433
 __video_do_ioctl+0x1975/0x1fc0 drivers/media/v4l2-core/v4l2-ioctl.c:2853
 video_usercopy+0x8ae/0x17d0 drivers/media/v4l2-core/v4l2-ioctl.c:3035
 video_ioctl2+0x9f/0xb0 drivers/media/v4l2-core/v4l2-ioctl.c:3079
 v4l2_ioctl+0x23f/0x270 drivers/media/v4l2-core/v4l2-dev.c:364
 do_vfs_ioctl+0xf36/0x2d30 fs/ioctl.c:46
 ksys_ioctl fs/ioctl.c:713 [inline]
 __do_sys_ioctl fs/ioctl.c:720 [inline]
 __se_sys_ioctl+0x1da/0x270 fs/ioctl.c:718
 __x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:718
 do_syscall_64+0xcd/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7

Local variable description: ----ev@v4l2_ctrl_add_event
Variable was created at:
 v4l2_ctrl_add_event+0x6e/0xc20 drivers/media/v4l2-core/v4l2-ctrls.c:4080
 v4l2_event_subscribe+0xf75/0x1240 drivers/media/v4l2-core/v4l2-event.c:251

Bytes 44-71 of 136 are uninitialized
Memory access of size 136 starts at ffff8881bcc903c0
Data copied to user address 0000000020000000
==================================================================

Crashes (410):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/12/16 13:44 https://github.com/google/kmsan.git master 0a602458c72c def91db3 .config console log report syz C ci-upstream-kmsan-gce
2019/03/27 19:03 https://github.com/google/kmsan.git master 3c26d882e695 4e668495 .config console log report ci-upstream-kmsan-gce
2019/03/27 16:56 https://github.com/google/kmsan.git master 3c26d882e695 4e668495 .config console log report ci-upstream-kmsan-gce
2019/03/27 06:06 https://github.com/google/kmsan.git master 3c26d882e695 55684ce1 .config console log report ci-upstream-kmsan-gce
2019/03/27 03:18 https://github.com/google/kmsan.git master 3c26d882e695 55684ce1 .config console log report ci-upstream-kmsan-gce
2019/03/26 22:27 https://github.com/google/kmsan.git master 3c26d882e695 55684ce1 .config console log report ci-upstream-kmsan-gce
2019/03/26 17:14 https://github.com/google/kmsan.git master 3c26d882e695 55684ce1 .config console log report ci-upstream-kmsan-gce
2019/03/26 13:51 https://github.com/google/kmsan.git master 3c26d882e695 55684ce1 .config console log report ci-upstream-kmsan-gce
2019/03/25 16:28 https://github.com/google/kmsan.git master c10a026b8dee 2c86e0a5 .config console log report ci-upstream-kmsan-gce
2019/03/25 14:34 https://github.com/google/kmsan.git master c10a026b8dee 2c86e0a5 .config console log report ci-upstream-kmsan-gce
2019/03/25 11:04 https://github.com/google/kmsan.git master c10a026b8dee 2c86e0a5 .config console log report ci-upstream-kmsan-gce
2019/03/25 09:04 https://github.com/google/kmsan.git master c10a026b8dee 2c86e0a5 .config console log report ci-upstream-kmsan-gce
2019/03/25 07:58 https://github.com/google/kmsan.git master c10a026b8dee 2c86e0a5 .config console log report ci-upstream-kmsan-gce
2019/03/24 23:44 https://github.com/google/kmsan.git master c10a026b8dee acbc5b7d .config console log report ci-upstream-kmsan-gce
2019/03/24 11:17 https://github.com/google/kmsan.git master c10a026b8dee acbc5b7d .config console log report ci-upstream-kmsan-gce
2019/03/24 05:06 https://github.com/google/kmsan.git master c10a026b8dee a2cef203 .config console log report ci-upstream-kmsan-gce
2019/03/24 01:49 https://github.com/google/kmsan.git master c10a026b8dee a2cef203 .config console log report ci-upstream-kmsan-gce
2019/03/23 18:13 https://github.com/google/kmsan.git master c10a026b8dee a2cef203 .config console log report ci-upstream-kmsan-gce
2019/03/23 07:53 https://github.com/google/kmsan.git master c10a026b8dee 3361bde5 .config console log report ci-upstream-kmsan-gce
2019/03/22 05:31 https://github.com/google/kmsan.git master c10a026b8dee dce6e62f .config console log report ci-upstream-kmsan-gce
2019/03/21 12:04 https://github.com/google/kmsan.git master c10a026b8dee 427ea487 .config console log report ci-upstream-kmsan-gce
2019/03/21 05:15 https://github.com/google/kmsan.git master c10a026b8dee 427ea487 .config console log report ci-upstream-kmsan-gce
2019/03/20 20:14 https://github.com/google/kmsan.git master c10a026b8dee a664c187 .config console log report ci-upstream-kmsan-gce
2019/03/20 18:04 https://github.com/google/kmsan.git master c10a026b8dee a664c187 .config console log report ci-upstream-kmsan-gce
2019/03/20 07:54 https://github.com/google/kmsan.git master 43cfd3b1484f 2458c1c6 .config console log report ci-upstream-kmsan-gce
2019/03/20 03:49 https://github.com/google/kmsan.git master 43cfd3b1484f 2458c1c6 .config console log report ci-upstream-kmsan-gce
2019/03/19 22:38 https://github.com/google/kmsan.git master 43cfd3b1484f e4549234 .config console log report ci-upstream-kmsan-gce
2019/03/19 11:42 https://github.com/google/kmsan.git master 43cfd3b1484f 46264c32 .config console log report ci-upstream-kmsan-gce
2019/03/19 07:14 https://github.com/google/kmsan.git master 43cfd3b1484f 46264c32 .config console log report ci-upstream-kmsan-gce
2019/03/18 23:29 https://github.com/google/kmsan.git master 43cfd3b1484f 4656beca .config console log report ci-upstream-kmsan-gce
2019/03/18 21:36 https://github.com/google/kmsan.git master 43cfd3b1484f 4656beca .config console log report ci-upstream-kmsan-gce
2019/03/18 19:45 https://github.com/google/kmsan.git master 43cfd3b1484f 4656beca .config console log report ci-upstream-kmsan-gce
2019/03/18 15:02 https://github.com/google/kmsan.git master 43cfd3b1484f 4656beca .config console log report ci-upstream-kmsan-gce
2019/03/17 20:23 https://github.com/google/kmsan.git master 43cfd3b1484f ba18afea .config console log report ci-upstream-kmsan-gce
2019/03/17 15:43 https://github.com/google/kmsan.git master 43cfd3b1484f ba18afea .config console log report ci-upstream-kmsan-gce
2019/03/17 14:34 https://github.com/google/kmsan.git master 43cfd3b1484f ba18afea .config console log report ci-upstream-kmsan-gce
2019/03/17 13:21 https://github.com/google/kmsan.git master 43cfd3b1484f ba18afea .config console log report ci-upstream-kmsan-gce
2019/03/17 08:45 https://github.com/google/kmsan.git master 43cfd3b1484f bab43553 .config console log report ci-upstream-kmsan-gce
2019/03/17 04:24 https://github.com/google/kmsan.git master 43cfd3b1484f bab43553 .config console log report ci-upstream-kmsan-gce
2019/03/16 22:20 https://github.com/google/kmsan.git master 43cfd3b1484f bab43553 .config console log report ci-upstream-kmsan-gce
2019/03/16 16:50 https://github.com/google/kmsan.git master 43cfd3b1484f bab43553 .config console log report ci-upstream-kmsan-gce
2019/03/16 09:01 https://github.com/google/kmsan.git master 43cfd3b1484f bab43553 .config console log report ci-upstream-kmsan-gce
2019/03/16 04:59 https://github.com/google/kmsan.git master 43cfd3b1484f bab43553 .config console log report ci-upstream-kmsan-gce
2019/03/16 01:18 https://github.com/google/kmsan.git master 43cfd3b1484f bab43553 .config console log report ci-upstream-kmsan-gce
2018/12/06 07:52 https://github.com/google/kmsan.git master 6f0597832d81 764b42c4 .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.