syzbot


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

Status: fixed on 2020/11/05 11:24
Reported-by: syzbot+efcd56750666f3cd2831@syzkaller.appspotmail.com
Fix commit: 1221d11e5c35 vt_ioctl: change VT_RESIZEX ioctl to check for error return from vc_resize()
First crash: 1827d, last: 1519d
Fix bisection: fixed by (bisect log) :
commit 1221d11e5c35db18323ade3d4b2130bde89cc9df
Author: George Kennedy <george.kennedy@oracle.com>
Date: Fri Jul 31 16:33:12 2020 +0000

  vt_ioctl: change VT_RESIZEX ioctl to check for error return from vc_resize()

  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in fbcon_get_font C error 35 1532d 1827d 0/1 upstream: reported C repro on 2019/12/03 02:00
upstream KASAN: slab-out-of-bounds Read in fbcon_get_font fbdev C done inconclusive 137 1521d 1826d 0/28 auto-obsoleted due to no activity on 2022/09/25 10:38

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:348 [inline]
BUG: KASAN: slab-out-of-bounds in fbcon_get_font+0x2b2/0x5e0 drivers/video/fbdev/core/fbcon.c:2443
Read of size 5 at addr ffff888096616a4c by task syz-executor271/7703

CPU: 0 PID: 7703 Comm: syz-executor271 Not tainted 4.19.89-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
 check_memory_region_inline mm/kasan/kasan.c:260 [inline]
 check_memory_region+0x123/0x190 mm/kasan/kasan.c:267
 memcpy+0x24/0x50 mm/kasan/kasan.c:302
 memcpy include/linux/string.h:348 [inline]
 fbcon_get_font+0x2b2/0x5e0 drivers/video/fbdev/core/fbcon.c:2443
 con_font_get drivers/tty/vt/vt.c:4400 [inline]
 con_font_op+0x20b/0x1250 drivers/tty/vt/vt.c:4559
 vt_ioctl+0xd2e/0x2530 drivers/tty/vt/vt_ioctl.c:913
 tty_ioctl+0x7f3/0x1510 drivers/tty/tty_io.c:2669
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688
 ksys_ioctl+0xab/0xd0 fs/ioctl.c:705
 __do_sys_ioctl fs/ioctl.c:712 [inline]
 __se_sys_ioctl fs/ioctl.c:710 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x447249
Code: e8 dc e6 ff ff 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 06 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f520575dce8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000006dcc48 RCX: 0000000000447249
RDX: 0000000020000140 RSI: 0000000000004b60 RDI: 0000000000000003
RBP: 00000000006dcc40 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000000e R11: 0000000000000246 R12: 00000000006dcc4c
R13: 00007fff1bb7e39f R14: 00007f520575e9c0 R15: 20c49ba5e353f7cf

Allocated by task 7698:
 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]
 fbcon_set_font+0x32d/0x860 drivers/video/fbdev/core/fbcon.c:2641
 con_font_set drivers/tty/vt/vt.c:4492 [inline]
 con_font_op+0xe18/0x1250 drivers/tty/vt/vt.c:4557
 vt_ioctl+0xd2e/0x2530 drivers/tty/vt/vt_ioctl.c:913
 tty_ioctl+0x7f3/0x1510 drivers/tty/tty_io.c:2669
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688
 ksys_ioctl+0xab/0xd0 fs/ioctl.c:705
 __do_sys_ioctl fs/ioctl.c:712 [inline]
 __se_sys_ioctl fs/ioctl.c:710 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff888096616640
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1036 bytes inside of
 2048-byte region [ffff888096616640, ffff888096616e40)
The buggy address belongs to the page:
page:ffffea0002598580 count:1 mapcount:0 mapping:ffff88812c31cc40 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffffea000215f688 ffffea00025aa188 ffff88812c31cc40
raw: 0000000000000000 ffff888096616640 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888096616900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888096616980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888096616a00: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
                                                 ^
 ffff888096616a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888096616b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (97):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/12/13 10:10 linux-4.19.y 312017a460d5 2a752b7c .config console log report syz C ci2-linux-4-19
2019/12/08 18:55 linux-4.19.y fb683b5e3f53 1508f453 .config console log report syz C ci2-linux-4-19
2019/12/02 21:11 linux-4.19.y 174651bdf802 ab342da3 .config console log report syz C ci2-linux-4-19
2020/01/03 01:55 linux-4.19.y c7ecf3e3a71c 25a0186e .config console log report syz ci2-linux-4-19
2020/10/06 00:44 linux-4.19.y b09c34517e1a 1880b4a9 .config console log report info ci2-linux-4-19
2020/09/29 15:25 linux-4.19.y 10ad6cfd5736 5abc3f1a .config console log report info ci2-linux-4-19
2020/09/03 06:50 linux-4.19.y f6d5cb9e2c06 abf9ba4f .config console log report ci2-linux-4-19
2020/08/28 02:54 linux-4.19.y f6d5cb9e2c06 816e0689 .config console log report ci2-linux-4-19
2020/08/26 20:21 linux-4.19.y f6d5cb9e2c06 318430cb .config console log report ci2-linux-4-19
2020/08/25 02:55 linux-4.19.y d18b78abc0c6 344da168 .config console log report ci2-linux-4-19
2020/08/12 01:50 linux-4.19.y c14d30dc9987 bb3e5fe6 .config console log report ci2-linux-4-19
2020/08/07 15:01 linux-4.19.y 961f830af065 28ac5c9e .config console log report ci2-linux-4-19
2020/08/07 09:49 linux-4.19.y 961f830af065 cb436c69 .config console log report ci2-linux-4-19
2020/07/30 12:14 linux-4.19.y 205a42ce2861 b0947553 .config console log report ci2-linux-4-19
2020/07/29 11:55 linux-4.19.y 205a42ce2861 19a8de55 .config console log report ci2-linux-4-19
2020/07/26 07:02 linux-4.19.y 20b3a3dfdf6c 1f7cc1ca .config console log report ci2-linux-4-19
2020/07/24 16:23 linux-4.19.y 20b3a3dfdf6c 554af388 .config console log report ci2-linux-4-19
2020/07/23 09:33 linux-4.19.y 20b3a3dfdf6c 340ea530 .config console log report ci2-linux-4-19
2020/07/23 05:49 linux-4.19.y 20b3a3dfdf6c 340ea530 .config console log report ci2-linux-4-19
2020/07/13 18:13 linux-4.19.y dce0f88600e4 f90ec899 .config console log report ci2-linux-4-19
2020/06/27 08:12 linux-4.19.y a39e75458e1c ffec44b5 .config console log report ci2-linux-4-19
2020/06/18 17:27 linux-4.19.y 3fc898571b97 3ea11d3f .config console log report ci2-linux-4-19
2020/06/17 14:43 linux-4.19.y 3fc898571b97 b6c46f43 .config console log report ci2-linux-4-19
2020/06/16 21:18 linux-4.19.y 3fc898571b97 4ea9d964 .config console log report ci2-linux-4-19
2020/06/15 09:32 linux-4.19.y 3fc898571b97 8e3ab941 .config console log report ci2-linux-4-19
2020/06/08 23:30 linux-4.19.y 106fa147d3da 0d60b78a .config console log report ci2-linux-4-19
2020/06/08 06:34 linux-4.19.y 106fa147d3da 7751efd0 .config console log report ci2-linux-4-19
2020/06/05 09:04 linux-4.19.y 4707d8e57273 2420d1bc .config console log report ci2-linux-4-19
2020/06/04 23:42 linux-4.19.y 4707d8e57273 6720fdef .config console log report ci2-linux-4-19
2020/06/01 18:04 linux-4.19.y 2d16cf4817bc a0331e89 .config console log report ci2-linux-4-19
2020/06/01 09:18 linux-4.19.y 2d16cf4817bc a0331e89 .config console log report ci2-linux-4-19
2020/05/30 04:23 linux-4.19.y 2d16cf4817bc 954bd312 .config console log report ci2-linux-4-19
2020/05/27 21:17 linux-4.19.y 2d16cf4817bc 9072c126 .config console log report ci2-linux-4-19
2020/05/26 23:57 linux-4.19.y 1bab61d3e8cd 9072c126 .config console log report ci2-linux-4-19
2020/05/26 12:08 linux-4.19.y 1bab61d3e8cd 8ca3b7d2 .config console log report ci2-linux-4-19
2020/05/23 20:25 linux-4.19.y 1bab61d3e8cd 4afdfa20 .config console log report ci2-linux-4-19
2020/05/21 00:29 linux-4.19.y 1bab61d3e8cd 4afdfa20 .config console log report ci2-linux-4-19
2020/05/09 08:06 linux-4.19.y 84920cc7fbe1 e97b06d3 .config console log report ci2-linux-4-19
2020/05/08 01:08 linux-4.19.y 84920cc7fbe1 6c70a1c2 .config console log report ci2-linux-4-19
2020/05/07 09:27 linux-4.19.y 84920cc7fbe1 4618eb2d .config console log report ci2-linux-4-19
2020/04/29 18:57 linux-4.19.y 765675379b62 ba2806db .config console log report ci2-linux-4-19
2020/04/26 22:35 linux-4.19.y 7edd66cf6167 0ce7569e .config console log report ci2-linux-4-19
2020/04/25 08:26 linux-4.19.y 7edd66cf6167 a113ba38 .config console log report ci2-linux-4-19
2020/04/22 03:03 linux-4.19.y 8e2406c85187 2e44d63e .config console log report ci2-linux-4-19
2020/04/17 18:37 linux-4.19.y 8488c3f3bc86 18397578 .config console log report ci2-linux-4-19
2020/04/16 18:05 linux-4.19.y 6dd0e32665e5 c743fcb3 .config console log report ci2-linux-4-19
2020/04/12 19:12 linux-4.19.y dda0e2920330 36b0b050 .config console log report ci2-linux-4-19
2020/04/07 10:10 linux-4.19.y dda0e2920330 99a96044 .config console log report ci2-linux-4-19
2020/03/29 00:44 linux-4.19.y 54b4fa6d3955 05736b29 .config console log report ci2-linux-4-19
2020/03/28 17:49 linux-4.19.y 54b4fa6d3955 f1ebdfba .config console log report ci2-linux-4-19
2020/03/25 20:47 linux-4.19.y 54b4fa6d3955 e8e6c7d2 .config console log report ci2-linux-4-19
2019/12/21 04:43 linux-4.19.y 7d120bf21c05 bc586918 .config console log report ci2-linux-4-19
2019/12/18 07:54 linux-4.19.y 7d120bf21c05 64ca0a37 .config console log report ci2-linux-4-19
2019/12/16 21:47 linux-4.19.y 312017a460d5 0ae38e44 .config console log report ci2-linux-4-19
2019/12/11 11:55 linux-4.19.y fb683b5e3f53 101194eb .config console log report ci2-linux-4-19
2019/12/07 21:53 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.