Re: UBSAN: invalid-load in param_get_bool

From: Dmitry Vyukov
Date: Mon Dec 21 2020 - 05:07:05 EST


On Thu, Dec 17, 2020 at 5:04 PM syzbot
<syzbot+438cc6c21c384f9efa5e@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: accefff5 Merge tag 'arm-soc-omap-genpd-5.11' of git://git...
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=12385613500000
> kernel config: https://syzkaller.appspot.com/x/.config?x=5d42216b510180e3
> dashboard link: https://syzkaller.appspot.com/bug?extid=438cc6c21c384f9efa5e
> compiler: gcc (GCC) 10.1.0-syz 20200507
>
> Unfortunately, I don't have any reproducer for this issue yet.
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+438cc6c21c384f9efa5e@xxxxxxxxxxxxxxxxxxxxxxxxx

+Kees

Now another upstream instance stopped working due to this UBSAN bug.
The bug is always triggered when test machines start, we already have 50K hits.

> ================================================================================
> UBSAN: invalid-load in kernel/params.c:302:33
> load of value 255 is not a valid value for type '_Bool'
> CPU: 0 PID: 8488 Comm: syz-fuzzer 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
> ubsan_epilogue+0xb/0x5a lib/ubsan.c:148
> __ubsan_handle_load_invalid_value.cold+0x62/0x6c lib/ubsan.c:427
> param_get_bool.cold+0x14/0x19 kernel/params.c:302
> param_attr_show+0x14a/0x220 kernel/params.c:549
> module_attr_show+0x48/0x70 kernel/params.c:884
> sysfs_kf_seq_show+0x1f8/0x400 fs/sysfs/file.c:61
> seq_read_iter+0x4d3/0x1220 fs/seq_file.c:227
> seq_read+0x3dd/0x5b0 fs/seq_file.c:159
> kernfs_fop_read+0xe9/0x590 fs/kernfs/file.c:251
> vfs_read+0x1b5/0x570 fs/read_write.c:494
> ksys_read+0x12d/0x250 fs/read_write.c:634
> do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
> entry_SYSCALL_64_after_hwframe+0x44/0xa9
> RIP: 0033:0x4b3d8b
> Code: ff e9 69 ff ff ff cc cc cc cc cc cc cc cc cc e8 db a1 f8 ff 48 8b 7c 24 10 48 8b 74 24 18 48 8b 54 24 20 48 8b 44 24 08 0f 05 <48> 3d 01 f0 ff ff 76 20 48 c7 44 24 28 ff ff ff ff 48 c7 44 24 30
> RSP: 002b:000000c0000a3740 EFLAGS: 00000202 ORIG_RAX: 0000000000000000
> RAX: ffffffffffffffda RBX: 000000c00002c000 RCX: 00000000004b3d8b
> RDX: 0000000000001200 RSI: 000000c000341300 RDI: 0000000000000006
> RBP: 000000c0000a3790 R08: 0000000000000001 R09: 0000000000000002
> R10: 0000000000001200 R11: 0000000000000202 R12: ffffffffffffffff
> R13: 0000000000000002 R14: 0000000000000001 R15: 0000000000000005
> ================================================================================
>
>
> ---
> This report 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 syzkaller@xxxxxxxxxxxxxxxx.
>
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.