syzbot


KASAN: slab-out-of-bounds Read in vcs_scr_readw

Status: fixed on 2020/09/18 07:23
Reported-by: syzbot+dfa7dd6873ddc1a97905@syzkaller.appspotmail.com
Fix commit: 627f3b9e4dd8 vcs: prevent write access to vcsu devices
First crash: 1815d, last: 1805d
Fix bisection the fix commit could be any of (bisect log):
  627f3b9e4dd8 vcs: prevent write access to vcsu devices
  fe0d31eddb9e binder: Fix race between mmap() and binder_alloc_print_pages()
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in vcs_scr_readw serial C done done 16 1814d 1814d 15/28 fixed on 2020/01/08 01:06

Sample crash report:
audit: type=1400 audit(1575572344.161:36): avc:  denied  { map } for  pid=7734 comm="syz-executor428" path="/root/syz-executor428105635" dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
==================================================================
BUG: KASAN: slab-out-of-bounds in vcs_scr_readw+0xc2/0xd0 drivers/tty/vt/vt.c:4618
Read of size 2 at addr ffff8880a540d440 by task syz-executor428/7734

CPU: 0 PID: 7734 Comm: syz-executor428 Not tainted 4.19.88-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+0x197/0x210 lib/dump_stack.c:118
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report mm/kasan/report.c:412 [inline]
 kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396
 __asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:431
 vcs_scr_readw+0xc2/0xd0 drivers/tty/vt/vt.c:4618
 vcs_write+0x646/0xcf0 drivers/tty/vt/vc_screen.c:526
 __vfs_write+0x114/0x810 fs/read_write.c:485
 __kernel_write+0x110/0x390 fs/read_write.c:506
 write_pipe_buf+0x15d/0x1f0 fs/splice.c:798
 splice_from_pipe_feed fs/splice.c:503 [inline]
 __splice_from_pipe+0x391/0x7d0 fs/splice.c:627
 splice_from_pipe+0x108/0x170 fs/splice.c:662
 default_file_splice_write+0x3c/0x90 fs/splice.c:810
 do_splice_from fs/splice.c:852 [inline]
 direct_splice_actor+0x123/0x190 fs/splice.c:1019
 splice_direct_to_actor+0x2e7/0x890 fs/splice.c:974
 do_splice_direct+0x1da/0x2a0 fs/splice.c:1062
 do_sendfile+0x597/0xce0 fs/read_write.c:1447
 __do_sys_sendfile64 fs/read_write.c:1508 [inline]
 __se_sys_sendfile64 fs/read_write.c:1494 [inline]
 __x64_sys_sendfile64+0x1dd/0x220 fs/read_write.c:1494
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4401f9
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd32dae608 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 00000000004401f9
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 000080001d00c0d0 R11: 0000000000000246 R12: 0000000000401a80
R13: 0000000000401b10 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 1:
 save_stack+0x45/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc mm/kasan/kasan.c:553 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531
 __do_kmalloc mm/slab.c:3727 [inline]
 __kmalloc+0x15d/0x750 mm/slab.c:3736
 kmalloc include/linux/slab.h:520 [inline]
 kzalloc include/linux/slab.h:709 [inline]
 vc_do_resize+0x262/0x14a0 drivers/tty/vt/vt.c:1190
 vc_resize+0x4d/0x60 drivers/tty/vt/vt.c:1307
 fbcon_init+0x1062/0x1b00 drivers/video/fbdev/core/fbcon.c:1179
 visual_init+0x337/0x620 drivers/tty/vt/vt.c:1054
 do_bind_con_driver+0x549/0x8c0 drivers/tty/vt/vt.c:3507
 do_take_over_console+0x449/0x590 drivers/tty/vt/vt.c:4068
 do_fbcon_takeover+0x116/0x220 drivers/video/fbdev/core/fbcon.c:556
 fbcon_fb_registered drivers/video/fbdev/core/fbcon.c:3228 [inline]
 fbcon_event_notify+0x1786/0x1dba drivers/video/fbdev/core/fbcon.c:3358
 notifier_call_chain+0xc2/0x230 kernel/notifier.c:93
 __blocking_notifier_call_chain kernel/notifier.c:317 [inline]
 __blocking_notifier_call_chain kernel/notifier.c:304 [inline]
 blocking_notifier_call_chain kernel/notifier.c:328 [inline]
 blocking_notifier_call_chain+0x94/0xb0 kernel/notifier.c:325
 fb_notifier_call_chain+0x25/0x30 drivers/video/fbdev/core/fb_notify.c:45
 do_register_framebuffer drivers/video/fbdev/core/fbmem.c:1708 [inline]
 register_framebuffer+0x61d/0xa70 drivers/video/fbdev/core/fbmem.c:1831
 vga16fb_probe+0x711/0x825 drivers/video/fbdev/vga16fb.c:1373
 platform_drv_probe+0x93/0x160 drivers/base/platform.c:582
 really_probe+0x4a0/0x650 drivers/base/dd.c:500
 driver_probe_device+0x103/0x1b0 drivers/base/dd.c:661
 __device_attach_driver+0x225/0x290 drivers/base/dd.c:748
 bus_for_each_drv+0x16c/0x1f0 drivers/base/bus.c:464
 __device_attach+0x237/0x350 drivers/base/dd.c:814
 device_initial_probe+0x1b/0x20 drivers/base/dd.c:861
 bus_probe_device+0x1f7/0x2a0 drivers/base/bus.c:524
 device_add+0xb42/0x1760 drivers/base/core.c:1985
 platform_device_add+0x366/0x6f0 drivers/base/platform.c:418
 vga16fb_init+0x15f/0x1d6 drivers/video/fbdev/vga16fb.c:1431
 do_one_initcall+0x107/0x78c init/main.c:883
 do_initcall_level init/main.c:951 [inline]
 do_initcalls init/main.c:959 [inline]
 do_basic_setup init/main.c:977 [inline]
 kernel_init_freeable+0x4d4/0x5c8 init/main.c:1144
 kernel_init+0x12/0x1c4 init/main.c:1061
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8880a540c180
 which belongs to the cache kmalloc-8192 of size 8192
The buggy address is located 4800 bytes inside of
 8192-byte region [ffff8880a540c180, ffff8880a540e180)
The buggy address belongs to the page:
page:ffffea0002950300 count:1 mapcount:0 mapping:ffff88812c315080 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffffea0002991108 ffffea00028c7c08 ffff88812c315080
raw: 0000000000000000 ffff8880a540c180 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a540d300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880a540d380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8880a540d400: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
                                           ^
 ffff8880a540d480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880a540d500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (80):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/12/05 19:02 linux-4.19.y fb683b5e3f53 9fd5a512 .config console log report syz C ci2-linux-4-19
2019/12/05 08:29 linux-4.19.y 174651bdf802 b2088328 .config console log report syz C ci2-linux-4-19
2019/12/03 06:10 linux-4.19.y 174651bdf802 ab342da3 .config console log report syz C ci2-linux-4-19
2019/12/03 05:11 linux-4.19.y 174651bdf802 ab342da3 .config console log report syz C ci2-linux-4-19
2019/12/04 18:32 linux-4.19.y 174651bdf802 b2088328 .config console log report syz ci2-linux-4-19
2019/12/12 21:22 linux-4.19.y fb683b5e3f53 08003f64 .config console log report ci2-linux-4-19
2019/12/12 18:38 linux-4.19.y fb683b5e3f53 08003f64 .config console log report ci2-linux-4-19
2019/12/12 15:01 linux-4.19.y fb683b5e3f53 d973f528 .config console log report ci2-linux-4-19
2019/12/12 12:34 linux-4.19.y fb683b5e3f53 d973f528 .config console log report ci2-linux-4-19
2019/12/12 10:15 linux-4.19.y fb683b5e3f53 d973f528 .config console log report ci2-linux-4-19
2019/12/12 05:47 linux-4.19.y fb683b5e3f53 d973f528 .config console log report ci2-linux-4-19
2019/12/12 04:44 linux-4.19.y fb683b5e3f53 0d368675 .config console log report ci2-linux-4-19
2019/12/12 02:00 linux-4.19.y fb683b5e3f53 0d368675 .config console log report ci2-linux-4-19
2019/12/11 23:03 linux-4.19.y fb683b5e3f53 0d368675 .config console log report ci2-linux-4-19
2019/12/11 20:06 linux-4.19.y fb683b5e3f53 0d368675 .config console log report ci2-linux-4-19
2019/12/11 18:29 linux-4.19.y fb683b5e3f53 0d368675 .config console log report ci2-linux-4-19
2019/12/11 13:33 linux-4.19.y fb683b5e3f53 101194eb .config console log report ci2-linux-4-19
2019/12/11 11:10 linux-4.19.y fb683b5e3f53 101194eb .config console log report ci2-linux-4-19
2019/12/11 09:15 linux-4.19.y fb683b5e3f53 101194eb .config console log report ci2-linux-4-19
2019/12/11 06:10 linux-4.19.y fb683b5e3f53 101194eb .config console log report ci2-linux-4-19
2019/12/10 17:56 linux-4.19.y fb683b5e3f53 4b83c8fb .config console log report ci2-linux-4-19
2019/12/10 16:10 linux-4.19.y fb683b5e3f53 4b83c8fb .config console log report ci2-linux-4-19
2019/12/10 14:52 linux-4.19.y fb683b5e3f53 4b83c8fb .config console log report ci2-linux-4-19
2019/12/10 13:49 linux-4.19.y fb683b5e3f53 4b83c8fb .config console log report ci2-linux-4-19
2019/12/10 11:27 linux-4.19.y fb683b5e3f53 4b83c8fb .config console log report ci2-linux-4-19
2019/12/10 00:07 linux-4.19.y fb683b5e3f53 b31eda3d .config console log report ci2-linux-4-19
2019/12/09 18:31 linux-4.19.y fb683b5e3f53 b31eda3d .config console log report ci2-linux-4-19
2019/12/09 16:41 linux-4.19.y fb683b5e3f53 b31eda3d .config console log report ci2-linux-4-19
2019/12/09 11:18 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
2019/12/09 04:52 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
2019/12/09 02:42 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
2019/12/08 21:29 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
2019/12/08 16:55 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
2019/12/08 05:36 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
2019/12/08 02:34 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
2019/12/08 01:43 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
2019/12/08 01:43 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
2019/12/07 17:13 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 17:12 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 16:36 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 16:24 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 16:23 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 16:22 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 16:21 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 16:19 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 16:18 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 16:15 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 15:31 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 15:27 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 06:58 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 06:52 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 04:40 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 03:54 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/07 01:30 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/06 22:44 linux-4.19.y fb683b5e3f53 85f26751 .config console log report ci2-linux-4-19
2019/12/06 13:55 linux-4.19.y fb683b5e3f53 12c3b6cd .config console log report ci2-linux-4-19
2019/12/06 13:55 linux-4.19.y fb683b5e3f53 12c3b6cd .config console log report ci2-linux-4-19
2019/12/06 13:52 linux-4.19.y fb683b5e3f53 12c3b6cd .config console log report ci2-linux-4-19
2019/12/06 13:51 linux-4.19.y fb683b5e3f53 12c3b6cd .config console log report ci2-linux-4-19
2019/12/06 07:42 linux-4.19.y fb683b5e3f53 98b4ef2d .config console log report ci2-linux-4-19
2019/12/05 18:46 linux-4.19.y fb683b5e3f53 9fd5a512 .config console log report ci2-linux-4-19
2019/12/05 18:45 linux-4.19.y fb683b5e3f53 9fd5a512 .config console log report ci2-linux-4-19
2019/12/05 16:59 linux-4.19.y fb683b5e3f53 9fd5a512 .config console log report ci2-linux-4-19
2019/12/05 10:21 linux-4.19.y 174651bdf802 b2088328 .config console log report ci2-linux-4-19
2019/12/05 00:44 linux-4.19.y 174651bdf802 b2088328 .config console log report ci2-linux-4-19
2019/12/05 00:35 linux-4.19.y 174651bdf802 b2088328 .config console log report ci2-linux-4-19
2019/12/04 18:38 linux-4.19.y 174651bdf802 b2088328 .config console log report ci2-linux-4-19
2019/12/04 08:58 linux-4.19.y 174651bdf802 0ecb9746 .config console log report ci2-linux-4-19
2019/12/04 08:01 linux-4.19.y 174651bdf802 0ecb9746 .config console log report ci2-linux-4-19
2019/12/03 16:28 linux-4.19.y 174651bdf802 ab342da3 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.