syzbot


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

Status: auto-closed as invalid on 2020/10/12 11:59
Subsystems: fbdev
[Documentation on labels]
Reported-by: syzbot+be70641646cda31e78d9@syzkaller.appspotmail.com
First crash: 1554d, last: 1409d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: slab-out-of-bounds Read in fb_pad_aligned_buffer 0 (1) 2020/01/21 08:07
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: slab-out-of-bounds Read in fb_pad_aligned_buffer 3 1470d 1547d 0/1 auto-closed as invalid on 2020/08/12 11:53

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in __fb_pad_aligned_buffer include/linux/fb.h:655 [inline]
BUG: KASAN: slab-out-of-bounds in fb_pad_aligned_buffer+0x137/0x150 drivers/video/fbdev/core/fbmem.c:116
Read of size 1 at addr ffff88805265288a by task syz-executor.2/27717

CPU: 1 PID: 27717 Comm: syz-executor.2 Not tainted 5.6.0-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+0x188/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:382
 __kasan_report.cold+0x35/0x4d mm/kasan/report.c:511
 kasan_report+0x33/0x50 mm/kasan/common.c:625
 __fb_pad_aligned_buffer include/linux/fb.h:655 [inline]
 fb_pad_aligned_buffer+0x137/0x150 drivers/video/fbdev/core/fbmem.c:116
 bit_putcs_aligned drivers/video/fbdev/core/bitblit.c:99 [inline]
 bit_putcs+0xc21/0xe10 drivers/video/fbdev/core/bitblit.c:185
 fbcon_putcs+0x345/0x3f0 drivers/video/fbdev/core/fbcon.c:1362
 con_flush drivers/tty/vt/vt.c:2568 [inline]
 do_con_write.part.0+0x7d1/0x1dc0 drivers/tty/vt/vt.c:2771
 do_con_write drivers/tty/vt/vt.c:2587 [inline]
 con_write+0x41/0xe0 drivers/tty/vt/vt.c:3153
 process_output_block drivers/tty/n_tty.c:595 [inline]
 n_tty_write+0x3f0/0xf90 drivers/tty/n_tty.c:2333
 do_tty_write drivers/tty/tty_io.c:962 [inline]
 tty_write+0x495/0x800 drivers/tty/tty_io.c:1046
 __vfs_write+0x76/0x100 fs/read_write.c:495
 vfs_write+0x268/0x5d0 fs/read_write.c:559
 ksys_write+0x12d/0x250 fs/read_write.c:612
 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
 entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x45c889
Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fa2d572ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fa2d572b6d4 RCX: 000000000045c889
RDX: 0000000000001006 RSI: 0000000020001440 RDI: 0000000000000004
RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000cd2 R14: 00000000004cef99 R15: 000000000076bf0c

Allocated by task 8437:
 save_stack+0x1b/0x40 mm/kasan/common.c:49
 set_track mm/kasan/common.c:57 [inline]
 __kasan_kmalloc mm/kasan/common.c:495 [inline]
 __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:468
 __do_kmalloc mm/slab.c:3656 [inline]
 __kmalloc+0x161/0x7a0 mm/slab.c:3665
 kmalloc include/linux/slab.h:560 [inline]
 fbcon_set_font+0x331/0x870 drivers/video/fbdev/core/fbcon.c:2672
 con_font_set drivers/tty/vt/vt.c:4565 [inline]
 con_font_op+0xd65/0x1160 drivers/tty/vt/vt.c:4630
 vt_ioctl+0x1793/0x26b0 drivers/tty/vt/vt_ioctl.c:980
 tty_ioctl+0xedc/0x1440 drivers/tty/tty_io.c:2656
 vfs_ioctl fs/ioctl.c:47 [inline]
 ksys_ioctl+0x11a/0x180 fs/ioctl.c:763
 __do_sys_ioctl fs/ioctl.c:772 [inline]
 __se_sys_ioctl fs/ioctl.c:770 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:770
 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
 entry_SYSCALL_64_after_hwframe+0x49/0xb3

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff888052652000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 2186 bytes inside of
 4096-byte region [ffff888052652000, ffff888052653000)
The buggy address belongs to the page:
page:ffffea0001499480 refcount:1 mapcount:0 mapping:0000000036a99e01 index:0x0 head:ffffea0001499480 order:1 compound_mapcount:0
flags: 0xfffe0000010200(slab|head)
raw: 00fffe0000010200 ffffea00014fd408 ffffea00021f7f08 ffff8880aa002000
raw: 0000000000000000 ffff888052652000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888052652780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888052652800: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888052652880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                      ^
 ffff888052652900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888052652980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/04/12 12:25 upstream b032227c6293 36b0b050 .config console log report ci-upstream-kasan-gce-root
2020/03/21 11:23 upstream 5ad0ec0b8652 4288d95e .config console log report ci-upstream-kasan-gce-smack-root
2020/02/29 07:30 upstream f8788d86ab28 59b57593 .config console log report ci-upstream-kasan-gce-smack-root
2020/01/30 06:04 upstream 39bed42de2e7 5ed23f9a .config console log report ci-upstream-kasan-gce-smack-root
2020/06/14 11:58 linux-next e7b08814b16b 2a22c77a .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/20 05:05 linux-next f4aba10148cd b690a6e3 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/01/21 07:42 linux-next 2747d5fdab78 8eda0b95 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.