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

17 views
Skip to first unread message

syzbot

unread,
Dec 2, 2019, 4:13:10 PM12/2/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 174651bd Linux 4.19.87
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=158f7abce00000
kernel config: https://syzkaller.appspot.com/x/.config?x=d306897dc6e131b7
dashboard link: https://syzkaller.appspot.com/bug?extid=cc2cb1ddc69b3336427b
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17fb3e7ee00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17db63f2e00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+cc2cb1...@syzkaller.appspotmail.com

audit: type=1400 audit(1575317365.009:36): avc: denied { map } for
pid=7564 comm="syz-executor743" path="/root/syz-executor743339208"
dev="sda1" ino=16484 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: global-out-of-bounds in vga_8planes_imageblit
drivers/video/fbdev/vga16fb.c:1140 [inline]
BUG: KASAN: global-out-of-bounds in vga_imageblit_expand
drivers/video/fbdev/vga16fb.c:1203 [inline]
BUG: KASAN: global-out-of-bounds in vga16fb_imageblit+0x1c8b/0x2200
drivers/video/fbdev/vga16fb.c:1260
Read of size 2 at addr ffffffff87ef13de by task syz-executor743/7564

CPU: 1 PID: 7564 Comm: syz-executor743 Not tainted 4.19.87-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+0x5/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
vga_8planes_imageblit drivers/video/fbdev/vga16fb.c:1140 [inline]
vga_imageblit_expand drivers/video/fbdev/vga16fb.c:1203 [inline]
vga16fb_imageblit+0x1c8b/0x2200 drivers/video/fbdev/vga16fb.c:1260
soft_cursor+0x4fb/0xa30 drivers/video/fbdev/core/softcursor.c:74
bit_cursor+0x12fc/0x1a60 drivers/video/fbdev/core/bitblit.c:386
fbcon_cursor+0x58a/0x7b0 drivers/video/fbdev/core/fbcon.c:1369
set_cursor drivers/tty/vt/vt.c:908 [inline]
set_cursor+0x1fb/0x280 drivers/tty/vt/vt.c:899
redraw_screen+0x60f/0x8e0 drivers/tty/vt/vt.c:1015
fbcon_modechanged+0x5f3/0x900 drivers/video/fbdev/core/fbcon.c:2969
fbcon_event_notify+0x1bd/0x1dba drivers/video/fbdev/core/fbcon.c:3344
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
fb_set_var+0xc8f/0xe80 drivers/video/fbdev/core/fbmem.c:1042
do_fb_ioctl+0x450/0xab0 drivers/video/fbdev/core/fbmem.c:1115
fb_ioctl+0xe6/0x130 drivers/video/fbdev/core/fbmem.c:1230
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:0x440309
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:00007ffcefe08b58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440309
RDX: 0000000020000340 RSI: 0000000000004601 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401b90
R13: 0000000000401c20 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the variable:
transl_h+0x3e/0x40

Memory state around the buggy address:
ffffffff87ef1280: 00 00 00 00 fa fa fa fa 00 00 00 00 fa fa fa fa
ffffffff87ef1300: 00 00 00 00 00 fa fa fa fa fa fa fa 04 fa fa fa
> ffffffff87ef1380: fa fa fa fa 00 00 00 00 fa fa fa fa 00 00 00 00
^
ffffffff87ef1400: fa fa fa fa 00 01 fa fa fa fa fa fa 00 00 00 04
ffffffff87ef1480: fa fa fa fa 00 00 04 fa fa fa fa fa 00 00 00 00
==================================================================


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Dec 2, 2019, 7:55:09 PM12/2/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: fbc5fe7a Linux 4.14.157
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14d62aeae00000
kernel config: https://syzkaller.appspot.com/x/.config?x=d49d9f4045dcfa5d
dashboard link: https://syzkaller.appspot.com/bug?extid=867a43b5e2e7dcd3c77f
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1181d196e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10a9f641e00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+867a43...@syzkaller.appspotmail.com

audit: type=1400 audit(1575330679.303:36): avc: denied { map } for
pid=7185 comm="syz-executor849" path="/root/syz-executor849948480"
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: global-out-of-bounds in vga_8planes_imageblit
drivers/video/fbdev/vga16fb.c:1141 [inline]
BUG: KASAN: global-out-of-bounds in vga_imageblit_expand
drivers/video/fbdev/vga16fb.c:1204 [inline]
BUG: KASAN: global-out-of-bounds in vga16fb_imageblit+0x1bdb/0x2160
drivers/video/fbdev/vga16fb.c:1261
Read of size 2 at addr ffffffff87087bde by task syz-executor849/7185

CPU: 1 PID: 7185 Comm: syz-executor849 Not tainted 4.14.157-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x142/0x197 lib/dump_stack.c:58
print_address_description.cold+0x5/0x1dc mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report mm/kasan/report.c:409 [inline]
kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
__asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:428
vga_8planes_imageblit drivers/video/fbdev/vga16fb.c:1141 [inline]
vga_imageblit_expand drivers/video/fbdev/vga16fb.c:1204 [inline]
vga16fb_imageblit+0x1bdb/0x2160 drivers/video/fbdev/vga16fb.c:1261
soft_cursor+0x4ff/0xa50 drivers/video/fbdev/core/softcursor.c:74
bit_cursor+0x11be/0x1830 drivers/video/fbdev/core/bitblit.c:386
fbcon_cursor+0x4e3/0x6f0 drivers/video/fbdev/core/fbcon.c:1347
set_cursor drivers/tty/vt/vt.c:602 [inline]
set_cursor+0x1bd/0x240 drivers/tty/vt/vt.c:593
redraw_screen+0x596/0x7c0 drivers/tty/vt/vt.c:706
fbcon_modechanged+0x59e/0x880 drivers/video/fbdev/core/fbcon.c:2946
fbcon_event_notify+0x11f/0x17af drivers/video/fbdev/core/fbcon.c:3299
notifier_call_chain+0x111/0x1b0 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+0x80/0xa0 kernel/notifier.c:325
fb_notifier_call_chain+0x25/0x30 drivers/video/fbdev/core/fb_notify.c:45
fb_set_var+0xb09/0xcf0 drivers/video/fbdev/core/fbmem.c:1054
do_fb_ioctl+0x3cc/0x940 drivers/video/fbdev/core/fbmem.c:1127
fb_ioctl+0xe6/0x130 drivers/video/fbdev/core/fbmem.c:1242
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:500 [inline]
do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684
SYSC_ioctl fs/ioctl.c:701 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x440309
RSP: 002b:00007ffda6bcee78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440309
RDX: 0000000020000340 RSI: 0000000000004601 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401b90
R13: 0000000000401c20 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the variable:
transl_h+0x3e/0x40

Memory state around the buggy address:
ffffffff87087a80: 00 03 fa fa fa fa fa fa 00 00 00 00 fa fa fa fa
ffffffff87087b00: 00 00 00 00 00 fa fa fa fa fa fa fa 04 fa fa fa
> ffffffff87087b80: fa fa fa fa 00 00 00 00 fa fa fa fa 00 00 00 00
^
ffffffff87087c00: fa fa fa fa 00 01 fa fa fa fa fa fa 00 00 00 04
ffffffff87087c80: fa fa fa fa 00 00 04 fa fa fa fa fa 00 00 00 00

syzbot

unread,
Nov 20, 2020, 6:03:06 AM11/20/20
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 0472aa0c36c7bb3756629a3bbc834604167567f7
Author: Tetsuo Handa <penguin...@i-love.sakura.ne.jp>
Date: Mon Aug 31 10:37:00 2020 +0000

video: fbdev: fix OOB read in vga_8planes_imageblit()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=15a0d046500000
start commit: d7e78d08 Linux 4.14.195
git tree: linux-4.14.y
kernel config: https://syzkaller.appspot.com/x/.config?x=6608b656f49b4e8c
dashboard link: https://syzkaller.appspot.com/bug?extid=867a43b5e2e7dcd3c77f
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17864c35900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13d9da25900000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: video: fbdev: fix OOB read in vga_8planes_imageblit()

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages