[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1501174127.26391.1.camel@gmail.com>
Date: Thu, 27 Jul 2017 12:48:47 -0400
From: Daniel Micay <danielmicay@...il.com>
To: kbuild test robot <lkp@...el.com>,
Kees Cook <keescook@...omium.org>
Cc: kbuild-all@...org, Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Al Viro <viro@...iv.linux.org.uk>,
David Howells <dhowells@...hat.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fortify: Use WARN instead of BUG for now
I think the 'else' added in the proposed patch makes it too complicated
for GCC to optimize out the __attribute__((error)) checks before they're
considered to be errors. It's not needed so it's probably best to just
avoid doing something like that. The runtime checks can't get false
positives from overly complex code but the compile-time ones depend on
GCC being able to reliably optimize them out.
This might be easier for GCC:
if (__builtin_constant_p(size) && condition_a) {
compiletimeerror();
}
if (__builtin_constant_p(size) && condition_b) {
compiletimeerror();
}
than the current:
if (__builtin_constant_p(size)) {
if (condition_a) {
compiletimeerror();
}
if (condition_b) {
compiletimeerror();
}
}
but it hasn't had a false positive like that with the current code.
Removing __noreturn is making the inline code more complex from GCC's
perspective too, but hopefully it's neither reducing coverage (i.e. not
making it less able to resolve __builtin_object_size - intuitively it
shouldn't impact it much but you never know) or making GCC unable to
deal with the compile-time checks.
Powered by blists - more mailing lists