syzbot


KASAN: global-out-of-bounds Read in smc_nl_get_sys_info

Status: fixed on 2021/03/10 01:49
Subsystems: net s390
[Documentation on labels]
Reported-by: syzbot+f4708c391121cfc58396@syzkaller.appspotmail.com
Fix commit: 25fe2c9c4cd2 smc: fix out of bound access in smc_nl_get_sys_info()
First crash: 1386d, last: 1356d
Cause bisection: failed (error log, bisect log)
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH net 0/2] net/smc: fix out of bound access in netlink interface 4 (4) 2021/01/13 04:30
[PATCH net] smc: fix out of bound access in smc_nl_get_sys_info() 2 (2) 2021/01/04 11:53
KASAN: global-out-of-bounds Read in smc_nl_get_sys_info 0 (1) 2020/12/20 13:14

Sample crash report:
==================================================================
BUG: KASAN: global-out-of-bounds in string_nocheck lib/vsprintf.c:611 [inline]
BUG: KASAN: global-out-of-bounds in string+0x39c/0x3d0 lib/vsprintf.c:693
Read of size 1 at addr ffffffff8faea960 by task syz-executor646/8509

CPU: 0 PID: 8509 Comm: syz-executor646 Not tainted 5.10.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5/0x4c8 mm/kasan/report.c:385
 __kasan_report mm/kasan/report.c:545 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
 string_nocheck lib/vsprintf.c:611 [inline]
 string+0x39c/0x3d0 lib/vsprintf.c:693
 vsnprintf+0x71b/0x14f0 lib/vsprintf.c:2618
 snprintf+0xbb/0xf0 lib/vsprintf.c:2751
 smc_nl_get_sys_info+0x493/0x880 net/smc/smc_core.c:249
 genl_lock_dumpit+0x60/0x90 net/netlink/genetlink.c:623
 netlink_dump+0x4b9/0xb70 net/netlink/af_netlink.c:2268
 __netlink_dump_start+0x642/0x900 net/netlink/af_netlink.c:2373
 genl_family_rcv_msg_dumpit+0x2af/0x310 net/netlink/genetlink.c:686
 genl_family_rcv_msg net/netlink/genetlink.c:780 [inline]
 genl_rcv_msg+0x434/0x580 net/netlink/genetlink.c:800
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811
 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330
 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2336
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2390
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2423
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x440299
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 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff4b943e58 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440299
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401aa0
R13: 0000000000401b30 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the variable:
 smc_hostname+0x20/0x40

Memory state around the buggy address:
 ffffffff8faea800: 00 00 f9 f9 f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9
 ffffffff8faea880: 00 00 f9 f9 f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9
>ffffffff8faea900: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 f9 f9 f9 f9
                                                       ^
 ffffffff8faea980: 04 f9 f9 f9 f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9
 ffffffff8faeaa00: 00 00 f9 f9 f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9
==================================================================

Crashes (27):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/16 13:33 net-old 3db1a3fa9880 f213e07e .config console log report syz C ci-upstream-net-this-kasan-gce
2020/12/16 13:18 bpf 3db1a3fa9880 f213e07e .config console log report syz C ci-upstream-bpf-kasan-gce
2020/12/16 13:40 bpf-next 3db1a3fa9880 f213e07e .config console log report syz C ci-upstream-bpf-next-kasan-gce
2020/12/16 13:33 net-next-old efd5a1584537 f213e07e .config console log report syz C ci-upstream-net-kasan-gce
2020/12/22 05:14 upstream 8653b778e454 04201c06 .config console log report info ci-upstream-kasan-gce
2020/12/16 13:12 upstream d635a69dd498 f213e07e .config console log report info ci-upstream-kasan-gce-386
2021/01/15 03:50 bpf 4237e9f4a962 65a7a854 .config console log report info ci-upstream-bpf-kasan-gce
2021/01/09 22:48 net-old c49243e88982 2c1f2513 .config console log report info ci-upstream-net-this-kasan-gce
2021/01/09 22:47 net-old c49243e88982 2c1f2513 .config console log report info ci-upstream-net-this-kasan-gce
2021/01/03 04:39 bpf da4282c17d69 79264ae3 .config console log report info ci-upstream-bpf-kasan-gce
2021/01/02 23:14 net-old 4bfc4714849d 79264ae3 .config console log report info ci-upstream-net-this-kasan-gce
2020/12/31 12:34 bpf da4282c17d69 5cc121d6 .config console log report info ci-upstream-bpf-kasan-gce
2020/12/29 20:15 bpf 4bfc4714849d 80910769 .config console log report info ci-upstream-bpf-kasan-gce
2020/12/23 23:54 bpf e7e518053c26 c2c1d1dd .config console log report info ci-upstream-bpf-kasan-gce
2020/12/22 18:22 bpf e7e518053c26 04201c06 .config console log report info ci-upstream-bpf-kasan-gce
2020/12/22 11:33 bpf e7e518053c26 04201c06 .config console log report info ci-upstream-bpf-kasan-gce
2020/12/21 11:12 net-old fec6079b2eea 04201c06 .config console log report info ci-upstream-net-this-kasan-gce
2020/12/19 00:49 bpf d467d80dc399 04201c06 .config console log report info ci-upstream-bpf-kasan-gce
2020/12/18 11:31 net-old 44d4775ca518 04201c06 .config console log report info ci-upstream-net-this-kasan-gce
2020/12/16 16:39 bpf 3db1a3fa9880 f213e07e .config console log report info ci-upstream-bpf-kasan-gce
2020/12/16 13:05 bpf 3db1a3fa9880 f213e07e .config console log report info ci-upstream-bpf-kasan-gce
2021/01/16 11:26 bpf-next eed6a9a9571b 65a7a854 .config console log report info ci-upstream-bpf-next-kasan-gce
2021/01/15 04:11 bpf-next bade5c554f1a 65a7a854 .config console log report info ci-upstream-bpf-next-kasan-gce
2021/01/15 03:30 bpf-next bade5c554f1a 65a7a854 .config console log report info ci-upstream-bpf-next-kasan-gce
2021/01/10 07:30 net-next-old 73b7a6047971 2c1f2513 .config console log report info ci-upstream-net-kasan-gce
2021/01/10 00:07 net-next-old 09b5b5fb3902 2c1f2513 .config console log report info ci-upstream-net-kasan-gce
2020/12/16 13:19 bpf-next 3db1a3fa9880 f213e07e .config console log report info ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.