syzbot


KASAN: slab-out-of-bounds Read in soft_cursor (2)

Status: fixed on 2021/06/23 17:43
Reported-by: syzbot+f1f9bc8c8cdcafc5ccfc@syzkaller.appspotmail.com
Fix commit: 8c5ec4a731e1 vt: Fix character height handling with VT_RESIZEX
First crash: 1275d, last: 1153d
Fix bisection: fixed by (bisect log) :
commit 8c5ec4a731e1e2d9b6906bcde62de57a609a9b86
Author: Maciej W. Rozycki <macro@orcam.me.uk>
Date: Thu May 13 09:51:50 2021 +0000

  vt: Fix character height handling with VT_RESIZEX

  
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in soft_cursor C unreliable 57 1158d 1689d 0/1 upstream: reported C repro on 2019/12/03 14:54
linux-4.19 KASAN: slab-out-of-bounds Read in soft_cursor C done 61 1351d 1689d 1/1 fixed on 2020/12/05 19:30
upstream KASAN: slab-out-of-bounds Read in soft_cursor fbdev C done 218 1379d 1688d 15/27 fixed on 2020/11/16 12:12
linux-5.15 KASAN: null-ptr-deref Read in soft_cursor origin:lts-only syz error 1 417d 418d 0/3 upstream: reported syz repro on 2023/05/28 00:20
linux-4.14 KASAN: use-after-free Read in soft_cursor C inconclusive 7 1177d 1688d 0/1 upstream: reported C repro on 2019/12/04 13:11
upstream general protection fault in soft_cursor fbdev C 3 418d 418d 22/27 fixed on 2023/07/01 16:05
linux-4.19 KASAN: global-out-of-bounds Read in soft_cursor C done 22 1151d 1618d 1/1 fixed on 2021/06/24 08:01
linux-4.14 KASAN: global-out-of-bounds Read in soft_cursor C error 19 677d 1677d 0/1 upstream: reported C repro on 2019/12/16 00:09
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2021/06/22 00:11 4h25m bisect fix linux-4.19.y OK (1) job log
2021/05/10 17:27 29m bisect fix linux-4.19.y OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:377 [inline]
BUG: KASAN: slab-out-of-bounds in soft_cursor+0x44b/0xa30 drivers/video/fbdev/core/softcursor.c:70
Read of size 15 at addr ffff8880af2e99b0 by task kworker/1:3/4697

CPU: 1 PID: 4697 Comm: kworker/1:3 Not tainted 4.19.190-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events_power_efficient fb_flashcursor
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report+0x8f/0xa0 mm/kasan/report.c:412
 memcpy+0x20/0x50 mm/kasan/kasan.c:302
 memcpy include/linux/string.h:377 [inline]
 soft_cursor+0x44b/0xa30 drivers/video/fbdev/core/softcursor.c:70
 bit_cursor+0x1126/0x1740 drivers/video/fbdev/core/bitblit.c:377
 fb_flashcursor+0x38c/0x430 drivers/video/fbdev/core/fbcon.c:379
 process_one_work+0x864/0x1570 kernel/workqueue.c:2152
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2295
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Allocated by task 8091:
 __do_kmalloc mm/slab.c:3727 [inline]
 __kmalloc+0x15a/0x3c0 mm/slab.c:3736
 kmalloc include/linux/slab.h:520 [inline]
 fbcon_set_font+0x34f/0x8a0 drivers/video/fbdev/core/fbcon.c:2482
 con_font_set drivers/tty/vt/vt.c:4537 [inline]
 con_font_op+0x94b/0xf20 drivers/tty/vt/vt.c:4581
 vt_ioctl+0x116b/0x2380 drivers/tty/vt/vt_ioctl.c:938
 tty_ioctl+0x5b0/0x15c0 drivers/tty/tty_io.c:2669
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
 __do_sys_ioctl fs/ioctl.c:712 [inline]
 __se_sys_ioctl fs/ioctl.c:710 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 4698:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 skb_free_head net/core/skbuff.c:563 [inline]
 skb_release_data+0x6de/0x920 net/core/skbuff.c:583
 skb_release_all net/core/skbuff.c:640 [inline]
 __kfree_skb net/core/skbuff.c:654 [inline]
 consume_skb+0x113/0x3d0 net/core/skbuff.c:714
 skb_free_datagram+0x16/0xf0 net/core/datagram.c:329
 netlink_recvmsg+0x627/0xea0 net/netlink/af_netlink.c:1988
 sock_recvmsg_nosec net/socket.c:795 [inline]
 sock_recvmsg net/socket.c:802 [inline]
 sock_recvmsg+0xca/0x110 net/socket.c:798
 ___sys_recvmsg+0x255/0x570 net/socket.c:2277
 __sys_recvmsg net/socket.c:2326 [inline]
 __do_sys_recvmsg net/socket.c:2336 [inline]
 __se_sys_recvmsg net/socket.c:2333 [inline]
 __x64_sys_recvmsg+0x12f/0x220 net/socket.c:2333
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880af2e97c0
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 496 bytes inside of
 512-byte region [ffff8880af2e97c0, ffff8880af2e99c0)
The buggy address belongs to the page:
page:ffffea0002bcba40 count:1 mapcount:0 mapping:ffff88813bff0940 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea0002899248 ffffea0002bcbc08 ffff88813bff0940
raw: 0000000000000000 ffff8880af2e9040 0000000100000006 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880af2e9880: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
 ffff8880af2e9900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880af2e9980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                     ^
 ffff8880af2e9a00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff8880af2e9a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/05/20 07:53 linux-4.19.y 3c8c23092588 a343ba6b .config console log report syz C ci2-linux-4-19 KASAN: slab-out-of-bounds Read in soft_cursor
2021/04/10 17:10 linux-4.19.y 830a059cbba6 6a81331a .config console log report syz C ci2-linux-4-19 KASAN: slab-out-of-bounds Read in soft_cursor
2021/05/22 11:56 linux-4.19.y 1e986fe9ad15 3c7fef33 .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in soft_cursor
2021/04/10 15:06 linux-4.19.y 830a059cbba6 6a81331a .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in soft_cursor
2021/04/03 06:17 linux-4.19.y 2034d6f0838e 6a81331a .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in soft_cursor
2021/03/31 11:56 linux-4.19.y 2034d6f0838e 6a81331a .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in soft_cursor
2021/03/26 15:28 linux-4.19.y 78fec1611cbf a8529b82 .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in soft_cursor
2021/01/20 08:34 linux-4.19.y 43d555d83c3f 63631df1 .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in soft_cursor
* Struck through repros no longer work on HEAD.