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

۱۶ بازدید
رفتن به اولین پیام خوانده‌نشده

syzbot

خوانده‌نشده،
۱۱ آذر ۱۳۹۸، ۱۷:۱۲:۰۹۱۳۹۸/۹/۱۱
به 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=137f877ae00000
kernel config: https://syzkaller.appspot.com/x/.config?x=d306897dc6e131b7
dashboard link: https://syzkaller.appspot.com/bug?extid=efcd56750666f3cd2831
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=175b3edae00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=136b9446e00000

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

audit: type=1400 audit(1575320817.081:36): avc: denied { map } for
pid=7633 comm="syz-executor404" path="/root/syz-executor404204206"
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: 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 16 at addr ffff88808ad25710 by task syz-executor404/7633

CPU: 0 PID: 7633 Comm: syz-executor404 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+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+0x1784/0x2530 drivers/tty/vt/vt_ioctl.c:965
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:0x4444d9
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 7b d8 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff165a01a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fff165a01b0 RCX: 00000000004444d9
RDX: 0000000020000440 RSI: 0000000000004b72 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000400da0
R10: 00007fff1659fcf0 R11: 0000000000000246 R12: 00000000004021e0
R13: 0000000000402270 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 7633:
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 ffff88808ad24d00
which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 2576 bytes inside of
4096-byte region [ffff88808ad24d00, ffff88808ad25d00)
The buggy address belongs to the page:
page:ffffea00022b4900 count:1 mapcount:0 mapping:ffff88812c31cdc0 index:0x0
compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffffea000231a988 ffff88812c314a48 ffff88812c31cdc0
raw: 0000000000000000 ffff88808ad24d00 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88808ad25600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88808ad25680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> ffff88808ad25700: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88808ad25780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88808ad25800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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

خوانده‌نشده،
۱۱ آذر ۱۳۹۸، ۲۱:۰۰:۰۹۱۳۹۸/۹/۱۱
به 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=12c2a90ee00000
kernel config: https://syzkaller.appspot.com/x/.config?x=d49d9f4045dcfa5d
dashboard link: https://syzkaller.appspot.com/bug?extid=4a3deed68e604c42d3a7
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=143b9446e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1207942ae00000

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

audit: type=1400 audit(1575334489.173:36): avc: denied { map } for
pid=6993 comm="syz-executor391" path="/root/syz-executor391329638"
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: slab-out-of-bounds in memcpy include/linux/string.h:347 [inline]
BUG: KASAN: slab-out-of-bounds in fbcon_get_font+0x288/0x550
drivers/video/fbdev/core/fbcon.c:2421
Read of size 16 at addr ffff8880a50c1290 by task syz-executor391/6993

CPU: 1 PID: 6993 Comm: syz-executor391 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+0x7c/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
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:347 [inline]
fbcon_get_font+0x288/0x550 drivers/video/fbdev/core/fbcon.c:2421
con_font_get drivers/tty/vt/vt.c:4078 [inline]
con_font_op+0x1d5/0x1060 drivers/tty/vt/vt.c:4229
vt_ioctl+0x179f/0x2170 drivers/tty/vt/vt_ioctl.c:979
tty_ioctl+0x841/0x1320 drivers/tty/tty_io.c:2661
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:0x4444d9
RSP: 002b:00007ffee4b581b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffee4b581c0 RCX: 00000000004444d9
RDX: 0000000020000440 RSI: 0000000000004b72 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000400da0
R10: 00007ffee4b57d00 R11: 0000000000000246 R12: 00000000004021e0
R13: 0000000000402270 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 6993:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x45/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc mm/kasan/kasan.c:551 [inline]
kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
__do_kmalloc mm/slab.c:3720 [inline]
__kmalloc+0x15d/0x7a0 mm/slab.c:3729
kmalloc include/linux/slab.h:493 [inline]
fbcon_set_font+0x2f8/0x7b0 drivers/video/fbdev/core/fbcon.c:2618
con_font_set drivers/tty/vt/vt.c:4162 [inline]
con_font_op+0xc0f/0x1060 drivers/tty/vt/vt.c:4227
vt_ioctl+0xb80/0x2170 drivers/tty/vt/vt_ioctl.c:927
tty_ioctl+0x841/0x1320 drivers/tty/tty_io.c:2661
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

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8880a50c0880
which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 2576 bytes inside of
4096-byte region [ffff8880a50c0880, ffff8880a50c1880)
The buggy address belongs to the page:
page:ffffea0002943000 count:1 mapcount:0 mapping:ffff8880a50c0880 index:0x0
compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff8880a50c0880 0000000000000000 0000000100000001
raw: ffffea0001eccda0 ffffea000247b6a0 ffff8880aa800dc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880a50c1180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8880a50c1200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> ffff8880a50c1280: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8880a50c1300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880a50c1380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc

syzbot

خوانده‌نشده،
۱۴ آبان ۱۳۹۹، ۲۳:۳۰:۰۵۱۳۹۹/۸/۱۴
به syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 1221d11e5c35db18323ade3d4b2130bde89cc9df
Author: George Kennedy <george....@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()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=163dccfa500000
start commit: 312017a4 Linux 4.19.89
git tree: linux-4.19.y
kernel config: https://syzkaller.appspot.com/x/.config?x=67c148d572dbab48
dashboard link: https://syzkaller.appspot.com/bug?extid=efcd56750666f3cd2831
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15d0d532e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=171ef851e00000

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

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

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
پاسخ به همه
پاسخ به نویسنده
فرستادن
0 پیام جدید