syzbot


KASAN: global-out-of-bounds Read in soft_cursor

Status: fixed on 2021/06/24 08:01
Reported-by: syzbot+4a1ae356fd4e26c7650f@syzkaller.appspotmail.com
Fix commit: 8c5ec4a731e1 vt: Fix character height handling with VT_RESIZEX
First crash: 1743d, last: 1276d
Fix bisection: fixed by (bisect log) :
commit 8c5ec4a731e1e2d9b6906bcde62de57a609a9b86
Author: Maciej W. Rozycki <macro@orcam.me.uk>
Date: Thu May 13 09:51:50 2021 +0000

  vt: Fix character height handling with VT_RESIZEX

  
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: global-out-of-bounds Read in soft_cursor fbdev 11 1580d 1806d 0/28 auto-closed as invalid on 2020/11/22 03:01
linux-4.14 KASAN: global-out-of-bounds Read in soft_cursor C error 19 803d 1802d 0/1 upstream: reported C repro on 2019/12/16 00:09
linux-5.15 KASAN: null-ptr-deref Read in soft_cursor origin:lts-only syz error 1 543d 543d 0/3 upstream: reported syz repro on 2023/05/28 00:20
linux-4.14 KASAN: use-after-free Read in soft_cursor C inconclusive 7 1303d 1814d 0/1 upstream: reported C repro on 2019/12/04 13:11
linux-4.19 KASAN: slab-out-of-bounds Read in soft_cursor (2) C done 8 1279d 1401d 1/1 fixed on 2021/06/23 17:43
upstream general protection fault in soft_cursor fbdev C 3 544d 544d 22/28 fixed on 2023/07/01 16:05
linux-4.14 KASAN: slab-out-of-bounds Read in soft_cursor C unreliable 57 1283d 1815d 0/1 upstream: reported C repro on 2019/12/03 14:54
Fix bisection attempts (5)
Created Duration User Patch Repo Result
2021/06/24 03:37 3h50m bisect fix linux-4.19.y OK (1) job log
2021/03/22 20:54 22m bisect fix linux-4.19.y OK (0) job log log
2021/02/20 20:32 21m bisect fix linux-4.19.y OK (0) job log log
2021/02/17 22:49 19m bisect fix linux-4.19.y error job log
2021/02/04 20:00 1m bisect fix linux-4.19.y error job log

Sample crash report:
==================================================================
BUG: KASAN: global-out-of-bounds in memcpy include/linux/string.h:373 [inline]
BUG: KASAN: global-out-of-bounds in soft_cursor+0x44b/0xa30 drivers/video/fbdev/core/softcursor.c:70
Read of size 32 at addr ffffffff88b65c10 by task syz-executor208/8107

CPU: 0 PID: 8107 Comm: syz-executor208 Not tainted 4.19.161-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+0x1fc/0x2fe lib/dump_stack.c:118
 print_address_description.cold+0x5/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354
 kasan_report+0x8f/0x96 mm/kasan/report.c:412
 memcpy+0x20/0x50 mm/kasan/kasan.c:302
 memcpy include/linux/string.h:373 [inline]
 soft_cursor+0x44b/0xa30 drivers/video/fbdev/core/softcursor.c:70
 bit_cursor+0x1126/0x1740 drivers/video/fbdev/core/bitblit.c:377
 fbcon_cursor+0x523/0x700 drivers/video/fbdev/core/fbcon.c:1309
 hide_cursor+0x85/0x2c0 drivers/tty/vt/vt.c:902
 update_region+0x136/0x190 drivers/tty/vt/vt.c:700
 vcs_write+0x403/0xc30 drivers/tty/vt/vc_screen.c:604
 __vfs_write+0xf7/0x770 fs/read_write.c:485
 vfs_write+0x1f3/0x540 fs/read_write.c:549
 ksys_write+0x12b/0x2a0 fs/read_write.c:599
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440389
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 db 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff77bd3d18 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440389
RDX: 0000000000000121 RSI: 00000000200000c0 RDI: 0000000000000004
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000401bf0
R13: 0000000000401c80 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the variable:
 oid_index+0x850/0xa60

Memory state around the buggy address:
 ffffffff88b65b00: fa fa fa fa 04 fa fa fa fa fa fa fa 07 fa fa fa
 ffffffff88b65b80: fa fa fa fa 04 fa fa fa fa fa fa fa 05 fa fa fa
>ffffffff88b65c00: fa fa fa fa 01 fa fa fa fa fa fa fa 00 00 02 fa
                         ^
 ffffffff88b65c80: fa fa fa fa 00 00 00 fa fa fa fa fa 00 00 00 00
 ffffffff88b65d00: 00 01 fa fa fa fa fa fa 00 00 00 00 01 fa fa fa
==================================================================

Crashes (22):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/06 17:17 linux-4.19.y daefdc9eb24b f12ba0c5 .config console log report syz C ci2-linux-4-19
2021/05/24 23:48 linux-4.19.y 1e986fe9ad15 3c7fef33 .config console log report info ci2-linux-4-19 KASAN: global-out-of-bounds Read in soft_cursor
2021/04/28 07:57 linux-4.19.y 2965db2e004c 77e2b668 .config console log report info ci2-linux-4-19 KASAN: global-out-of-bounds Read in soft_cursor
2021/04/18 12:34 linux-4.19.y 2965db2e004c 7e2b734b .config console log report info ci2-linux-4-19 KASAN: global-out-of-bounds Read in soft_cursor
2021/03/27 19:09 linux-4.19.y 78fec1611cbf a8529b82 .config console log report info ci2-linux-4-19 KASAN: global-out-of-bounds Read in soft_cursor
2021/03/27 11:12 linux-4.19.y 78fec1611cbf a8529b82 .config console log report info ci2-linux-4-19 KASAN: global-out-of-bounds Read in soft_cursor
2021/01/05 19:59 linux-4.19.y 3207316b3bee a0234d98 .config console log report info ci2-linux-4-19
2020/12/30 08:36 linux-4.19.y 13d2ce42de8c 0fa352f2 .config console log report info ci2-linux-4-19
2020/12/20 05:40 linux-4.19.y 13d2ce42de8c 04201c06 .config console log report info ci2-linux-4-19
2020/12/07 03:28 linux-4.19.y daefdc9eb24b c521566d .config console log report info ci2-linux-4-19
2020/12/06 21:36 linux-4.19.y daefdc9eb24b c521566d .config console log report info ci2-linux-4-19
2020/12/06 16:48 linux-4.19.y daefdc9eb24b f12ba0c5 .config console log report info ci2-linux-4-19
2020/11/13 03:12 linux-4.19.y 31acccdc8774 16fca0c8 .config console log report info ci2-linux-4-19
2020/10/21 02:06 linux-4.19.y ad326970d25c ff4a3345 .config console log report info ci2-linux-4-19
2020/08/10 09:49 linux-4.19.y 961f830af065 70301872 .config console log report ci2-linux-4-19
2020/05/11 18:39 linux-4.19.y 033c4ea49a4b f8f57555 .config console log report ci2-linux-4-19
2020/05/01 09:28 linux-4.19.y 765675379b62 143a10e9 .config console log report ci2-linux-4-19
2020/04/27 19:20 linux-4.19.y 7edd66cf6167 0ce7569e .config console log report ci2-linux-4-19
2020/04/08 23:28 linux-4.19.y dda0e2920330 db9bcd4b .config console log report ci2-linux-4-19
2020/02/19 20:31 linux-4.19.y 4fccc2503536 47fae6e9 .config console log report ci2-linux-4-19
2020/02/17 00:22 linux-4.19.y 9b15f7fae677 1f448cd6 .config console log report ci2-linux-4-19
2020/02/12 19:07 linux-4.19.y 357668399cf7 84f4fc8a .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.