KASAN: out-of-bounds Read in __switch_to (2)

18 views
Skip to first unread message

syzbot

unread,
Oct 3, 2020, 7:09:16 AM10/3/20
to 0x7f4...@gmail.com, b...@alien8.de, chang.s...@intel.com, h...@zytor.com, linux-...@vger.kernel.org, lu...@kernel.org, mi...@redhat.com, sas...@kernel.org, syzkall...@googlegroups.com, tg...@linutronix.de, x...@kernel.org
Hello,

syzbot found the following issue on:

HEAD commit: fb0155a0 Merge tag 'nfs-for-5.9-3' of git://git.linux-nfs...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15147bc3900000
kernel config: https://syzkaller.appspot.com/x/.config?x=41b736b7ce1b3ea4
dashboard link: https://syzkaller.appspot.com/bug?extid=2667188e965125ab6e7a
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11743a37900000

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

==================================================================
BUG: KASAN: out-of-bounds in arch_end_context_switch arch/x86/include/asm/paravirt.h:625 [inline]
BUG: KASAN: out-of-bounds in __switch_to+0xddc/0xfe0 arch/x86/kernel/process_64.c:566
Read of size 8 at addr ffffffff89fc6bd8 by task swapper/1/0

CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.9.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:

The buggy address belongs to the variable:
pv_ops+0x118/0x2c0

Memory state around the buggy address:
ffffffff89fc6a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffff89fc6b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffff89fc6b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
ffffffff89fc6c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffff89fc6c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
Kernel panic - not syncing: panic_on_warn set ...
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G B 5.9.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This report 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 issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Oct 8, 2020, 12:09:06 AM10/8/20
to anant.th...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
BUG: unable to handle kernel paging request in cfb_imageblit

BUG: unable to handle page fault for address: ffff888001000028
#PF: supervisor write access in kernel mode
#PF: error_code(0x0003) - permissions violation
PGD e201067 P4D e201067 PUD e202067 PMD 80000000010001e1
Oops: 0003 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 8647 Comm: syz-executor.5 Not tainted 5.9.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__writel arch/x86/include/asm/io.h:71 [inline]
RIP: 0010:slow_imageblit drivers/video/fbdev/core/cfbimgblt.c:178 [inline]
RIP: 0010:cfb_imageblit+0x87a/0x1010 drivers/video/fbdev/core/cfbimgblt.c:302
Code: ff d3 e0 09 04 24 e8 05 3b 8a fd 45 39 e7 0f 87 45 ff ff ff e8 17 3f 8a fd 48 8b 44 24 10 8b 14 24 48 8d 70 04 48 89 74 24 10 <89> 10 44 89 e6 44 89 ff e8 d9 3a 8a fd 45 39 e7 0f 85 07 ff ff ff
RSP: 0018:ffffc9000aecf828 EFLAGS: 00010293
RAX: ffff888001000028 RBX: 0000000000000000 RCX: ffffffff83ebffeb
RDX: 0000000000000000 RSI: ffff88800100002c RDI: 0000000000000004
RBP: 0000000000000000 R08: ffff888218601d1f R09: ffffffff8d0c49e7
R10: 000000000000001c R11: 0000000000000000 R12: 000000000000001c
R13: 0000000000000000 R14: ffff888218601d1a R15: 000000000000001c
FS: 00007fc683a11700(0000) GS:ffff8880ae400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff888001000028 CR3: 00000000a2cb7000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
vga_imageblit_expand drivers/video/fbdev/vga16fb.c:1207 [inline]
vga16fb_imageblit+0x693/0x2210 drivers/video/fbdev/vga16fb.c:1260
soft_cursor+0x514/0xa30 drivers/video/fbdev/core/softcursor.c:74
bit_cursor+0xcfe/0x1720 drivers/video/fbdev/core/bitblit.c:377
fbcon_cursor+0x50e/0x620 drivers/video/fbdev/core/fbcon.c:1348
set_cursor drivers/tty/vt/vt.c:919 [inline]
set_cursor+0x1d2/0x240 drivers/tty/vt/vt.c:910
con_flush_chars drivers/tty/vt/vt.c:3330 [inline]
con_flush_chars drivers/tty/vt/vt.c:3319 [inline]
con_write+0x8f/0xb0 drivers/tty/vt/vt.c:3251
do_output_char+0x5de/0x850 drivers/tty/n_tty.c:447
process_output drivers/tty/n_tty.c:514 [inline]
n_tty_write+0x481/0xf80 drivers/tty/n_tty.c:2345
do_tty_write drivers/tty/tty_io.c:962 [inline]
tty_write+0x4d9/0x870 drivers/tty/tty_io.c:1046
vfs_write+0x2b0/0x730 fs/read_write.c:584
ksys_write+0x12d/0x250 fs/read_write.c:639
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45dd99
Code: 0d b4 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 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fc683a10c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000000393c0 RCX: 000000000045dd99
RDX: 0000000000001006 RSI: 0000000020001440 RDI: 0000000000000008
RBP: 000000000118c008 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bfd4
R13: 00007fff44f43a8f R14: 00007fc683a119c0 R15: 000000000118bfd4
Modules linked in:
CR2: ffff888001000028
---[ end trace 68af5cba77037996 ]---
RIP: 0010:__writel arch/x86/include/asm/io.h:71 [inline]
RIP: 0010:slow_imageblit drivers/video/fbdev/core/cfbimgblt.c:178 [inline]
RIP: 0010:cfb_imageblit+0x87a/0x1010 drivers/video/fbdev/core/cfbimgblt.c:302
Code: ff d3 e0 09 04 24 e8 05 3b 8a fd 45 39 e7 0f 87 45 ff ff ff e8 17 3f 8a fd 48 8b 44 24 10 8b 14 24 48 8d 70 04 48 89 74 24 10 <89> 10 44 89 e6 44 89 ff e8 d9 3a 8a fd 45 39 e7 0f 85 07 ff ff ff
RSP: 0018:ffffc9000aecf828 EFLAGS: 00010293
RAX: ffff888001000028 RBX: 0000000000000000 RCX: ffffffff83ebffeb
RDX: 0000000000000000 RSI: ffff88800100002c RDI: 0000000000000004
RBP: 0000000000000000 R08: ffff888218601d1f R09: ffffffff8d0c49e7
R10: 000000000000001c R11: 0000000000000000 R12: 000000000000001c
R13: 0000000000000000 R14: ffff888218601d1a R15: 000000000000001c
FS: 00007fc683a11700(0000) GS:ffff8880ae400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff888001000028 CR3: 00000000a2cb7000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


Tested on:

commit: c85fb28b Merge tag 'arm64-fixes' of git://git.kernel.org/p..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17e3f5e7900000
kernel config: https://syzkaller.appspot.com/x/.config?x=6cb98cdceecd7fc2

syzbot

unread,
Oct 29, 2020, 10:10:10 AM10/29/20
to 0x7f4...@gmail.com, anant.th...@gmail.com, b.zoln...@samsung.com, b...@alien8.de, chang.s...@intel.com, dan.ca...@oracle.com, george....@oracle.com, h...@zytor.com, linux-...@vger.kernel.org, lu...@kernel.org, mi...@redhat.com, sas...@kernel.org, syzkall...@googlegroups.com, tg...@linutronix.de, x...@kernel.org
syzbot suspects this issue was fixed by commit:

commit a49145acfb975d921464b84fe00279f99827d816
Author: George Kennedy <george....@oracle.com>
Date: Tue Jul 7 19:26:03 2020 +0000

fbmem: add margin check to fb_check_caps()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=174684b8500000
start commit: fb0155a0 Merge tag 'nfs-for-5.9-3' of git://git.linux-nfs...
git tree: upstream
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11743a37900000

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

#syz fix: fbmem: add margin check to fb_check_caps()

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Dmitry Vyukov

unread,
Nov 11, 2020, 6:10:07 AM11/11/20
to syzbot, Dmitry Safonov, Anant Thazhemadam, Bartlomiej Zolnierkiewicz, Borislav Petkov, chang.s...@intel.com, Dan Carpenter, George Kennedy, H. Peter Anvin, LKML, Andy Lutomirski, Ingo Molnar, Sasha Levin, syzkaller-bugs, Thomas Gleixner, the arch/x86 maintainers
Reply all
Reply to author
Forward
0 new messages