Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 10 Jun 2021 10:52:37 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Kees Cook <keescook@...omium.org>
Cc: Yonghong Song <yhs@...com>, Dmitry Vyukov <dvyukov@...gle.com>, 
	Kurt Manucredo <fuzzybritches0@...il.com>, 
	syzbot+bed360704c521841c85d@...kaller.appspotmail.com, 
	Andrii Nakryiko <andrii@...nel.org>, Alexei Starovoitov <ast@...nel.org>, bpf <bpf@...r.kernel.org>, 
	Daniel Borkmann <daniel@...earbox.net>, "David S. Miller" <davem@...emloft.net>, 
	Jesper Dangaard Brouer <hawk@...nel.org>, John Fastabend <john.fastabend@...il.com>, 
	Martin KaFai Lau <kafai@...com>, KP Singh <kpsingh@...nel.org>, Jakub Kicinski <kuba@...nel.org>, 
	LKML <linux-kernel@...r.kernel.org>, Network Development <netdev@...r.kernel.org>, 
	Song Liu <songliubraving@...com>, syzkaller-bugs <syzkaller-bugs@...glegroups.com>, 
	nathan@...nel.org, Nick Desaulniers <ndesaulniers@...gle.com>, 
	Clang-Built-Linux ML <clang-built-linux@...glegroups.com>, 
	linux-kernel-mentees@...ts.linuxfoundation.org, 
	Shuah Khan <skhan@...uxfoundation.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
	Kernel Hardening <kernel-hardening@...ts.openwall.com>, 
	kasan-dev <kasan-dev@...glegroups.com>
Subject: Re: [PATCH v4] bpf: core: fix shift-out-of-bounds in ___bpf_prog_run

On Thu, Jun 10, 2021 at 10:06 AM Kees Cook <keescook@...omium.org> wrote:
>
> > > I guess the main question: what should happen if a bpf program writer
> > > does _not_ use compiler nor check_shl_overflow()?
>
> I think the BPF runtime needs to make such actions defined, instead of
> doing a blind shift. It needs to check the size of the shift explicitly
> when handling the shift instruction.

Such ideas were brought up in the past and rejected.
We're not going to sacrifice performance to make behavior a bit more
'defined'. CPUs are doing it deterministically. It's the C standard
that needs fixing.

> Sure, but the point of UBSAN is to find and alert about undefined
> behavior, so we still need to fix this.

No. The undefined behavior of C standard doesn't need "fixing" most of the time.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.