[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whs05rO37wjdTOgppP-N+mYy70Q2ctBrp6vMoUP=OtcVA@mail.gmail.com>
Date: Thu, 14 Jul 2022 14:48:37 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Kees Cook <keescook@...omium.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nathan Chancellor <nathan@...nel.org>,
Tom Rix <trix@...hat.com>, Marco Elver <elver@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
clang-built-linux <llvm@...ts.linux.dev>,
Alexander Potapenko <glider@...gle.com>
Subject: Re: [PATCH] ubsan: disable UBSAN_DIV_ZERO for clang
On Thu, Jul 14, 2022 at 2:38 PM Nick Desaulniers
<ndesaulniers@...gle.com> wrote:
>
> int do_div (int dividend, int divisor) {
> return dividend / divisor;
> }
>
> has UB should divisor ever be zero, not much different from:
So?
What about the million other '/' in the kernel?
Adding one check to 'do_div()' is just stupid. It's like using a
bottle-cap as an umbrella.
Nick, that's the whole _point_ of having compiler support for things
like this - automation. Because doing them manually one at a time is
just completely broken and stupid.
Linus
Powered by blists - more mailing lists