syzbot


KMSAN: kernel-infoleak in fb_cmap_to_user

Status: fixed on 2021/11/10 00:50
Reported-by: syzbot+47fa9c9c648b765305b9@syzkaller.appspotmail.com
Fix commit: 19ab233989d0 fbdev: zero-fill colormap in fbcmap.c
First crash: 589d, last: 438d
Patch testing requests:
Created Duration User Patch Repo Result
2021/03/31 15:30 23m phil@philpotter.co.uk patch https://github.com/google/kmsan.git master OK
2021/03/31 09:13 33m phil@philpotter.co.uk patch https://github.com/google/kmsan.git master report log
2021/03/25 20:44 15m phil@philpotter.co.uk https://github.com/google/kmsan.git master report log

Sample crash report:
=====================================================
BUG: KMSAN: kernel-infoleak in kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
CPU: 0 PID: 8216 Comm: syz-executor147 Not tainted 5.12.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x24c/0x2e0 lib/dump_stack.c:120
 kmsan_report+0xfb/0x1e0 mm/kmsan/kmsan_report.c:118
 kmsan_internal_check_memory+0x48c/0x520 mm/kmsan/kmsan.c:437
 kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
 instrument_copy_to_user include/linux/instrumented.h:121 [inline]
 _copy_to_user+0x1ac/0x270 lib/usercopy.c:33
 copy_to_user include/linux/uaccess.h:209 [inline]
 fb_cmap_to_user+0x40a/0x990 drivers/video/fbdev/core/fbcmap.c:208
 do_fb_ioctl+0xc53/0x1090 drivers/video/fbdev/core/fbmem.c:1136
 fb_ioctl+0x1e4/0x210 drivers/video/fbdev/core/fbmem.c:1185
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl+0x311/0x4d0 fs/ioctl.c:739
 __x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:739
 do_syscall_64+0x9f/0x140 arch/x86/entry/common.c:48
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43fbd9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 90 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc012a3b78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043fbd9
RDX: 0000000020007400 RSI: 0000000000004604 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007ffc012a3d18 R09: 00007ffc012a3d18
R10: 00007ffc012a35f0 R11: 0000000000000246 R12: 0000000000403460
R13: 431bde82d7b634db R14: 00000000004ad018 R15: 0000000000400488

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:121 [inline]
 kmsan_internal_poison_shadow+0x5c/0xf0 mm/kmsan/kmsan.c:104
 kmsan_slab_alloc+0x8e/0xe0 mm/kmsan/kmsan_hooks.c:76
 slab_alloc_node mm/slub.c:2922 [inline]
 slab_alloc mm/slub.c:2931 [inline]
 __kmalloc+0x387/0x550 mm/slub.c:4068
 kmalloc include/linux/slab.h:559 [inline]
 fb_alloc_cmap_gfp+0x39b/0xa70 drivers/video/fbdev/core/fbcmap.c:104
 fb_alloc_cmap+0x95/0xb0 drivers/video/fbdev/core/fbcmap.c:135
 drm_fb_helper_alloc_fbi+0x106/0x3f0 drivers/gpu/drm/drm_fb_helper.c:563
 drm_fb_helper_generic_probe+0x4f3/0xc70 drivers/gpu/drm/drm_fb_helper.c:2330
 drm_fb_helper_single_fb_probe drivers/gpu/drm/drm_fb_helper.c:1668 [inline]
 __drm_fb_helper_initial_config_and_unlock+0x1cac/0x26c0 drivers/gpu/drm/drm_fb_helper.c:1826
 drm_fb_helper_initial_config drivers/gpu/drm/drm_fb_helper.c:1921 [inline]
 drm_fbdev_client_hotplug+0xbb8/0xd70 drivers/gpu/drm/drm_fb_helper.c:2423
 drm_fbdev_generic_setup+0x39d/0xa00 drivers/gpu/drm/drm_fb_helper.c:2510
 vkms_create drivers/gpu/drm/vkms/vkms_drv.c:178 [inline]
 vkms_init+0x9d6/0xc43 drivers/gpu/drm/vkms/vkms_drv.c:202
 do_one_initcall+0x362/0x8d0 init/main.c:1229
 do_initcall_level+0x1e7/0x35a init/main.c:1302
 do_initcalls+0x127/0x1cb init/main.c:1318
 do_basic_setup+0x33/0x36 init/main.c:1338
 kernel_init_freeable+0x287/0x3cc init/main.c:1540
 kernel_init+0x1f/0x840 init/main.c:1427
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

Bytes 0-1 of 2 are uninitialized
Memory access of size 2 starts at ffff88810494f3c0
Data copied to user address 0000000020007300
=====================================================
=====================================================
BUG: KMSAN: kernel-infoleak in kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
CPU: 0 PID: 8216 Comm: syz-executor147 Tainted: G    B             5.12.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x24c/0x2e0 lib/dump_stack.c:120
 kmsan_report+0xfb/0x1e0 mm/kmsan/kmsan_report.c:118
 kmsan_internal_check_memory+0x48c/0x520 mm/kmsan/kmsan.c:437
 kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
 instrument_copy_to_user include/linux/instrumented.h:121 [inline]
 _copy_to_user+0x1ac/0x270 lib/usercopy.c:33
 copy_to_user include/linux/uaccess.h:209 [inline]
 fb_cmap_to_user+0x60c/0x990 drivers/video/fbdev/core/fbcmap.c:210
 do_fb_ioctl+0xc53/0x1090 drivers/video/fbdev/core/fbmem.c:1136
 fb_ioctl+0x1e4/0x210 drivers/video/fbdev/core/fbmem.c:1185
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl+0x311/0x4d0 fs/ioctl.c:739
 __x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:739
 do_syscall_64+0x9f/0x140 arch/x86/entry/common.c:48
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43fbd9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 90 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc012a3b78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043fbd9
RDX: 0000000020007400 RSI: 0000000000004604 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007ffc012a3d18 R09: 00007ffc012a3d18
R10: 00007ffc012a35f0 R11: 0000000000000246 R12: 0000000000403460
R13: 431bde82d7b634db R14: 00000000004ad018 R15: 0000000000400488

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:121 [inline]
 kmsan_internal_poison_shadow+0x5c/0xf0 mm/kmsan/kmsan.c:104
 kmsan_slab_alloc+0x8e/0xe0 mm/kmsan/kmsan_hooks.c:76
 slab_alloc_node mm/slub.c:2922 [inline]
 slab_alloc mm/slub.c:2931 [inline]
 __kmalloc+0x387/0x550 mm/slub.c:4068
 kmalloc include/linux/slab.h:559 [inline]
 fb_alloc_cmap_gfp+0x42d/0xa70 drivers/video/fbdev/core/fbcmap.c:107
 fb_alloc_cmap+0x95/0xb0 drivers/video/fbdev/core/fbcmap.c:135
 drm_fb_helper_alloc_fbi+0x106/0x3f0 drivers/gpu/drm/drm_fb_helper.c:563
 drm_fb_helper_generic_probe+0x4f3/0xc70 drivers/gpu/drm/drm_fb_helper.c:2330
 drm_fb_helper_single_fb_probe drivers/gpu/drm/drm_fb_helper.c:1668 [inline]
 __drm_fb_helper_initial_config_and_unlock+0x1cac/0x26c0 drivers/gpu/drm/drm_fb_helper.c:1826
 drm_fb_helper_initial_config drivers/gpu/drm/drm_fb_helper.c:1921 [inline]
 drm_fbdev_client_hotplug+0xbb8/0xd70 drivers/gpu/drm/drm_fb_helper.c:2423
 drm_fbdev_generic_setup+0x39d/0xa00 drivers/gpu/drm/drm_fb_helper.c:2510
 vkms_create drivers/gpu/drm/vkms/vkms_drv.c:178 [inline]
 vkms_init+0x9d6/0xc43 drivers/gpu/drm/vkms/vkms_drv.c:202
 do_one_initcall+0x362/0x8d0 init/main.c:1229
 do_initcall_level+0x1e7/0x35a init/main.c:1302
 do_initcalls+0x127/0x1cb init/main.c:1318
 do_basic_setup+0x33/0x36 init/main.c:1338
 kernel_init_freeable+0x287/0x3cc init/main.c:1540
 kernel_init+0x1f/0x840 init/main.c:1427
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

Bytes 0-1 of 2 are uninitialized
Memory access of size 2 starts at ffff888142d363c0
=====================================================

Crashes (439):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kmsan-gce 2021/05/07 07:25 https://github.com/google/kmsan.git master 4ebaab5fb428 06585184 .config log report syz C KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/02/15 14:18 https://github.com/google/kmsan.git master 29ad81a1074a 98682e5e .config log report syz C KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/16 06:42 https://github.com/google/kmsan.git master 57b5797c8013 f115ae98 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/15 21:22 https://github.com/google/kmsan.git master 57b5797c8013 b9a2f64e .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/13 20:47 https://github.com/google/kmsan.git master 57b5797c8013 fa0594c3 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/10 11:23 https://github.com/google/kmsan.git master 57b5797c8013 8f5a7b8c .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/10 05:47 https://github.com/google/kmsan.git master 57b5797c8013 8f5a7b8c .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/08 23:34 https://github.com/google/kmsan.git master 57b5797c8013 1b20171a .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/08 09:45 https://github.com/google/kmsan.git master 57b5797c8013 95793bce .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/08 00:44 https://github.com/google/kmsan.git master 57b5797c8013 4846d5c1 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/07 23:15 https://github.com/google/kmsan.git master 57b5797c8013 4846d5c1 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/05 23:32 https://github.com/google/kmsan.git master 57b5797c8013 55aa55c2 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/05 05:36 https://github.com/google/kmsan.git master 57b5797c8013 55aa55c2 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/05 03:16 https://github.com/google/kmsan.git master 57b5797c8013 55aa55c2 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/04 21:57 https://github.com/google/kmsan.git master 57b5797c8013 55aa55c2 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/04 18:24 https://github.com/google/kmsan.git master 57b5797c8013 55aa55c2 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/03 04:21 https://github.com/google/kmsan.git master 57b5797c8013 55aa55c2 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/07/01 10:59 https://github.com/google/kmsan.git master 57b5797c8013 658ebc66 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/29 09:29 https://github.com/google/kmsan.git master 57b5797c8013 9d2ab5df .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/28 14:46 https://github.com/google/kmsan.git master 57b5797c8013 9d2ab5df .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/26 16:29 https://github.com/google/kmsan.git master 57b5797c8013 9d2ab5df .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/25 12:47 https://github.com/google/kmsan.git master a520ce29b172 0edbbe31 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/25 04:48 https://github.com/google/kmsan.git master a520ce29b172 0edbbe31 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/23 14:11 https://github.com/google/kmsan.git master 6a6a67f21dec aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/23 09:23 https://github.com/google/kmsan.git master 6a6a67f21dec aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/23 04:20 https://github.com/google/kmsan.git master 6a6a67f21dec aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/22 18:40 https://github.com/google/kmsan.git master 6a6a67f21dec aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/21 08:49 https://github.com/google/kmsan.git master 6a6a67f21dec aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/20 04:33 https://github.com/google/kmsan.git master 6a6a67f21dec aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/18 11:32 https://github.com/google/kmsan.git master bfeba8b4c158 aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/18 11:31 https://github.com/google/kmsan.git master bfeba8b4c158 aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/17 02:18 https://github.com/google/kmsan.git master 89a0faf20faa aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/06/16 21:20 https://github.com/google/kmsan.git master 89a0faf20faa c06f97ad .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce 2021/02/15 13:08 https://github.com/google/kmsan.git master 29ad81a1074a 98682e5e .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/15 12:10 https://github.com/google/kmsan.git master 57b5797c8013 b9a2f64e .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/11 15:15 https://github.com/google/kmsan.git master 57b5797c8013 8f5a7b8c .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/11 03:52 https://github.com/google/kmsan.git master 57b5797c8013 8f5a7b8c .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/11 01:23 https://github.com/google/kmsan.git master 57b5797c8013 8f5a7b8c .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/10 07:03 https://github.com/google/kmsan.git master 57b5797c8013 8f5a7b8c .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/09 22:37 https://github.com/google/kmsan.git master 57b5797c8013 281e815f .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/09 00:41 https://github.com/google/kmsan.git master 57b5797c8013 1b20171a .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/08 11:08 https://github.com/google/kmsan.git master 57b5797c8013 95793bce .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/07 23:17 https://github.com/google/kmsan.git master 57b5797c8013 4846d5c1 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/07/02 00:25 https://github.com/google/kmsan.git master 57b5797c8013 658ebc66 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/06/28 15:50 https://github.com/google/kmsan.git master 57b5797c8013 9d2ab5df .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/06/28 06:43 https://github.com/google/kmsan.git master 57b5797c8013 9d2ab5df .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/06/25 05:00 https://github.com/google/kmsan.git master a520ce29b172 0edbbe31 .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/06/22 10:58 https://github.com/google/kmsan.git master 6a6a67f21dec aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/06/22 09:21 https://github.com/google/kmsan.git master 6a6a67f21dec aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/06/22 05:03 https://github.com/google/kmsan.git master 6a6a67f21dec aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/06/19 11:50 https://github.com/google/kmsan.git master bfeba8b4c158 aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
ci-upstream-kmsan-gce-386 2021/06/17 18:48 https://github.com/google/kmsan.git master 89a0faf20faa aba2b2fb .config log report info KMSAN: kernel-infoleak in fb_cmap_to_user
* Struck through repros no longer work on HEAD.