From: Christian Brauner <brauner@kernel.org>
To: "Björn Töpel" <bjorn@kernel.org>
Cc: syzbot <syzbot+522a57d8d5a0f7ac5c6c@syzkaller.appspotmail.com>,
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [kernel?] upstream test error: UBSAN: array-index-out-of-bounds in alloc_pid
Date: Thu, 29 Jun 2023 13:19:59 +0200 [thread overview]
Message-ID: <20230629-ozonkonzentration-elche-0484e2c863dc@brauner> (raw)
In-Reply-To: <87352a7dwe.fsf@all.your.base.are.belong.to.us>
On Thu, Jun 29, 2023 at 12:37:21PM +0200, Björn Töpel wrote:
> syzbot <syzbot+522a57d8d5a0f7ac5c6c@syzkaller.appspotmail.com> writes:
>
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit: 6aeadf7896bf Merge tag 'docs-arm64-move' of git://git.lwn...
> > git tree: upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=12cea2c7280000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=652d39e0420afbb8
> > dashboard link: https://syzkaller.appspot.com/bug?extid=522a57d8d5a0f7ac5c6c
> > compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
> >
> > Downloadable assets:
> > disk image: https://storage.googleapis.com/syzbot-assets/3887d048a41c/disk-6aeadf78.raw.xz
> > vmlinux: https://storage.googleapis.com/syzbot-assets/b25a7d5f9034/vmlinux-6aeadf78.xz
> > kernel image: https://storage.googleapis.com/syzbot-assets/96457fbed62d/bzImage-6aeadf78.xz
> >
> > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > Reported-by: syzbot+522a57d8d5a0f7ac5c6c@syzkaller.appspotmail.com
> >
> > ================================================================================
> > UBSAN: array-index-out-of-bounds in kernel/pid.c:244:3
> > index 1 is out of range for type 'struct upid[1]'
> > CPU: 1 PID: 4996 Comm: syz-executor.0 Not tainted 6.4.0-syzkaller-01761-g6aeadf7896bf #0
> > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
> > Call Trace:
> > <TASK>
> > __dump_stack lib/dump_stack.c:88 [inline]
> > dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
> > ubsan_epilogue lib/ubsan.c:217 [inline]
> > __ubsan_handle_out_of_bounds+0x11c/0x150 lib/ubsan.c:348
> > alloc_pid+0x405/0xc40 kernel/pid.c:244
> > copy_process+0x1f2f/0x4350 kernel/fork.c:2523
> > kernel_clone+0x222/0x800 kernel/fork.c:2915
> > __do_sys_clone kernel/fork.c:3058 [inline]
> > __se_sys_clone kernel/fork.c:3042 [inline]
> > __x64_sys_clone+0x258/0x2a0 kernel/fork.c:3042
> > do_syscall_x64 arch/x86/entry/common.c:50 [inline]
> > do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
> > entry_SYSCALL_64_after_hwframe+0x63/0xcd
> > RIP: 0033:0x7f30e5e89fab
> > Code: ed 0f 85 60 01 00 00 64 4c 8b 0c 25 10 00 00 00 45 31 c0 4d 8d 91 d0 02 00 00 31 d2 31 f6 bf 11 00 20 01 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 89 00 00 00 41 89 c5 85 c0 0f 85 90 00 00
> > RSP: 002b:00007ffe72312890 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
> > RAX: ffffffffffffffda RBX: 00007ffe72312ee8 RCX: 00007f30e5e89fab
> > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
> > RBP: 0000000000000000 R08: 0000000000000000 R09: 000055555643c400
> > R10: 000055555643c6d0 R11: 0000000000000246 R12: 0000000000000000
> > R13: 00007ffe72312980 R14: 00007f30e5fac9d8 R15: 000000000000000c
> > </TASK>
> > ================================================================================
>
> FWIW, I hit this with the clone3 kselftest (on riscv).
This is caused by not using a proper flexible array member for struct
upid in struct pid. I sent a pull request with Kees' fix for this
yesterday.
prev parent reply other threads:[~2023-06-29 11:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 9:29 syzbot
2023-06-29 10:37 ` Björn Töpel
2023-06-29 11:19 ` Christian Brauner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230629-ozonkonzentration-elche-0484e2c863dc@brauner \
--to=brauner@kernel.org \
--cc=bjorn@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+522a57d8d5a0f7ac5c6c@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®