All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Kees Cook <keescook@chromium.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Dmitry Vyukov <dvyukov@google.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] ubsan: remove overflow checks
Date: Wed, 10 Feb 2021 08:50:08 +0100	[thread overview]
Message-ID: <YCOQMIjZUGWqvHgA@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <202102091617.8FD77890@keescook>

On Tue, Feb 09, 2021 at 04:19:03PM -0800, Kees Cook wrote:
> On Wed, Feb 10, 2021 at 02:23:48AM +0300, Andrey Ryabinin wrote:
> > Since GCC 8.0 -fsanitize=signed-integer-overflow doesn't work with -fwrapv.
> > -fwrapv makes signed overflows defines and GCC essentially disables
> > ubsan checks. On GCC < 8.0 -fwrapv doesn't have influence on
> > -fsanitize=signed-integer-overflow setting, so it kinda works
> > but generates false-positves and violates uaccess rules:
> > 
> > lib/iov_iter.o: warning: objtool: iovec_from_user()+0x22d: call to __ubsan_handle_add_overflow() with UACCESS enabled
> > 
> > Disable signed overflow checks to avoid these problems.
> > Remove unsigned overflow checks as well.
> > Unsigned overflow appeared as side effect of the commit
> >  cdf8a76fda4a ("ubsan: move cc-option tests into Kconfig"),
> > but it never worked (kernel doesn't boot). And unsigned overflows
> > are allowed by C standard, so it just pointless.
> > 
> > Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
> 
> NAK, please don't remove the entire thing. I want this to work again
> with -fwrapv, and it's not entirely broken under Clang. But the feature
> shouldn't be removed from the kernel.
> 
> I'd prefer Peter's fix instead.

But what do you want it to do? This is UBsan, there's no UB.

If you want signed overflow warnings, call it something else. But I'll
still hate it :-)

FWIW:

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

  reply	other threads:[~2021-02-10  7:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 12:52 linux-next: Tree for Feb 8 Stephen Rothwell
2021-02-08 19:30 ` linux-next: Tree for Feb 8 (objtool: warnings: 5) Randy Dunlap
2021-02-08 21:21   ` Josh Poimboeuf
2021-02-08 21:39     ` Randy Dunlap
2021-02-09 22:59       ` Josh Poimboeuf
2021-02-10  0:16         ` Randy Dunlap
2021-02-09  8:06     ` Peter Zijlstra
2021-02-09 23:23       ` [PATCH] ubsan: remove overflow checks Andrey Ryabinin
2021-02-10  0:19         ` Kees Cook
2021-02-10  7:50           ` Peter Zijlstra [this message]
2021-02-10 11:55           ` Andrey Rybainin
2021-02-09  8:34   ` [PATCH] lockdep: Noinstr annotate warn_bogus_irq_restore() Peter Zijlstra
2021-02-09 13:24     ` Mark Rutland
2021-02-09 16:03       ` Peter Zijlstra
2021-02-09 16:13         ` Mark Rutland
2021-02-09 18:28         ` Randy Dunlap
2021-02-10 13:59         ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2021-02-09  3:33 ` linux-next: Tree for Feb 8 (Warning at arch/x86/kernel/irq.c:390) Randy Dunlap
2021-02-09 10:17   ` Borislav Petkov

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=YCOQMIjZUGWqvHgA@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=ryabinin.a.a@gmail.com \
    --cc=sfr@canb.auug.org.au \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.