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

14 views
Skip to first unread message

syzbot

unread,
Jan 27, 2020, 11:25:10 PM1/27/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 88d6de67 Linux 4.19.99
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15b6805ee00000
kernel config: https://syzkaller.appspot.com/x/.config?x=bbdca1178922fa69
dashboard link: https://syzkaller.appspot.com/bug?extid=5c33faac95cbacbed812
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

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

==================================================================
BUG: KASAN: slab-out-of-bounds in __fb_pad_aligned_buffer include/linux/fb.h:674 [inline]
BUG: KASAN: slab-out-of-bounds in fb_pad_aligned_buffer+0x138/0x160 drivers/video/fbdev/core/fbmem.c:122
Read of size 1 at addr ffff88807cbe608a by task syz-executor.3/1517

CPU: 1 PID: 1517 Comm: syz-executor.3 Not tainted 4.19.99-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
__asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430
__fb_pad_aligned_buffer include/linux/fb.h:674 [inline]
fb_pad_aligned_buffer+0x138/0x160 drivers/video/fbdev/core/fbmem.c:122
bit_putcs_aligned drivers/video/fbdev/core/bitblit.c:99 [inline]
bit_putcs+0xd14/0xf10 drivers/video/fbdev/core/bitblit.c:185
fbcon_putcs+0x42b/0x4f0 drivers/video/fbdev/core/fbcon.c:1320
fbcon_redraw.isra.0+0x2e2/0x490 drivers/video/fbdev/core/fbcon.c:1775
fbcon_scroll+0xbae/0x3780 drivers/video/fbdev/core/fbcon.c:1936
con_scroll+0x5b4/0x6b0 drivers/tty/vt/vt.c:631
lf+0x285/0x2e0 drivers/tty/vt/vt.c:1454
do_con_trol+0x605/0x6070 drivers/tty/vt/vt.c:2122
do_con_write.part.0+0xfd5/0x1eb0 drivers/tty/vt/vt.c:2773
do_con_write drivers/tty/vt/vt.c:2541 [inline]
con_write+0x46/0xd0 drivers/tty/vt/vt.c:3110
do_output_char+0x5f7/0x880 drivers/tty/n_tty.c:445
process_output drivers/tty/n_tty.c:512 [inline]
n_tty_write+0x4b5/0x1140 drivers/tty/n_tty.c:2343
do_tty_write drivers/tty/tty_io.c:960 [inline]
tty_write+0x458/0x7a0 drivers/tty/tty_io.c:1044
__vfs_write+0x114/0x810 fs/read_write.c:485
vfs_write+0x20c/0x560 fs/read_write.c:549
ksys_write+0x14f/0x2d0 fs/read_write.c:599
__do_sys_write fs/read_write.c:611 [inline]
__se_sys_write fs/read_write.c:608 [inline]
__x64_sys_write+0x73/0xb0 fs/read_write.c:608
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45b349
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:00007f147c12ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f147c12f6d4 RCX: 000000000045b349
RDX: 0000000000000054 RSI: 00000000200004c0 RDI: 0000000000000011
RBP: 000000000075c118 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000c98 R14: 00000000004cd777 R15: 000000000075c124

Allocated by task 16883:
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+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

Freed by task 16266:
save_stack+0x45/0xd0 mm/kasan/kasan.c:448
set_track mm/kasan/kasan.c:460 [inline]
__kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
__cache_free mm/slab.c:3503 [inline]
kfree+0xcf/0x220 mm/slab.c:3822
skb_free_head+0x99/0xc0 net/core/skbuff.c:554
skb_release_data+0x619/0x8d0 net/core/skbuff.c:574
skb_release_all+0x4d/0x60 net/core/skbuff.c:631
__kfree_skb net/core/skbuff.c:645 [inline]
kfree_skb net/core/skbuff.c:663 [inline]
kfree_skb+0xe8/0x390 net/core/skbuff.c:657
skb_queue_purge+0x19/0x40 net/core/skbuff.c:2858
netlink_sock_destruct+0x110/0x2a0 net/netlink/af_netlink.c:403
__sk_destruct+0x53/0x780 net/core/sock.c:1558
sk_destruct+0xc8/0x100 net/core/sock.c:1598
__sk_free+0xce/0x300 net/core/sock.c:1609
sk_free+0x45/0x50 net/core/sock.c:1620
deferred_put_nlk_sk+0x115/0x290 net/netlink/af_netlink.c:743
__rcu_reclaim kernel/rcu/rcu.h:236 [inline]
rcu_do_batch kernel/rcu/tree.c:2584 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2864 [inline]
rcu_process_callbacks+0xba0/0x1a30 kernel/rcu/tree.c:2881
__do_softirq+0x25c/0x921 kernel/softirq.c:292

The buggy address belongs to the object at ffff88807cbe4640
which belongs to the cache kmalloc-8192 of size 8192
The buggy address is located 6730 bytes inside of
8192-byte region [ffff88807cbe4640, ffff88807cbe6640)
The buggy address belongs to the page:
page:ffffea0001f2f900 count:1 mapcount:0 mapping:ffff88812c315080 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffffea0001731b08 ffffea0001958208 ffff88812c315080
raw: 0000000000000000 ffff88807cbe4640 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88807cbe5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807cbe6000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88807cbe6080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88807cbe6100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807cbe6180: 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

unread,
Aug 12, 2020, 7:53:13 AM8/12/20
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages