syzbot


KASAN: stack-out-of-bounds Write in ax25_getname
Status: fixed on 2020/03/17 21:24
Reported-by: syzbot+9217858d06d8c49f6936@syzkaller.appspotmail.com
Fix commit: ff8e12b0cfe2 vhost: Check docket sk_family instead of call getname
First crash: 1129d, last: 833d

Fix bisection: fixed by (bisect log) :
commit ff8e12b0cfe277a54edbab525f068b39c7ed0de3
Author: Eugenio PΓ©rez <eperezma@redhat.com>
Date: Thu Mar 5 16:30:05 2020 +0000

  vhost: Check docket sk_family instead of call getname

similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: stack-out-of-bounds Write in ax25_getname C done 4 833d 1128d 1/1 fixed on 2020/03/17 21:24
upstream KASAN: stack-out-of-bounds Write in ax25_getname C done error 21 830d 1246d 0/22 upstream: reported C repro on 2018/12/29 19:11

Sample crash report:
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1581778085.897:36): avc:  denied  { map } for  pid=7381 comm="syz-executor393" path="/root/syz-executor393150704" 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: stack-out-of-bounds in memset include/linux/string.h:332 [inline]
BUG: KASAN: stack-out-of-bounds in ax25_getname+0x55/0x7a0 net/ax25/af_ax25.c:1409
Write of size 72 at addr ffff88808e087cf8 by task syz-executor393/7381

CPU: 0 PID: 7381 Comm: syz-executor393 Not tainted 4.14.171-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
 memset+0x24/0x40 mm/kasan/kasan.c:285
 memset include/linux/string.h:332 [inline]
 ax25_getname+0x55/0x7a0 net/ax25/af_ax25.c:1409
 get_raw_socket drivers/vhost/net.c:1044 [inline]
 get_socket drivers/vhost/net.c:1101 [inline]
 vhost_net_set_backend drivers/vhost/net.c:1136 [inline]
 vhost_net_ioctl+0xe91/0x14c0 drivers/vhost/net.c:1312
 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:0x440259
RSP: 002b:00007fffb18f7ad8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440259
RDX: 0000000020f1dff8 RSI: 000000004008af30 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000401ae0
R13: 0000000000401b70 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea00023821c0 count:0 mapcount:0 mapping:          (null) index:0x0
flags: 0xfffe0000000000()
raw: 00fffe0000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 0000000100000001 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808e087c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1
 ffff88808e087c80: f1 f1 f1 04 f2 04 f2 00 f2 f2 f2 00 f2 f2 f2 00
>ffff88808e087d00: 00 00 00 00 00 04 f3 f3 f3 f3 f3 00 00 00 00 00
                                  ^
 ffff88808e087d80: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2
 ffff88808e087e00: 00 00 00 f2 f2 f2 f2 f2 00 00 00 00 f3 f3 f3 f3
==================================================================

Crashes (4):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2020/02/15 14:50 linux-4.14.y 98db2bf27b9e 5d7b90f1 .config log report syz C
ci2-linux-4-14 2019/11/14 20:58 linux-4.14.y 775d01b65b5d 048f2d49 .config log report syz
ci2-linux-4-14 2019/04/25 23:27 linux-4.14.y 68d7a45eec10 f46aabc8 .config log report syz
ci2-linux-4-14 2020/02/15 14:10 linux-4.14.y 98db2bf27b9e 5d7b90f1 .config log report