From: Mark Rutland <mark.rutland@arm.com>
To: Alexander Potapenko <glider@google.com>
Cc: Kees Cook <keescook@chromium.org>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Dmitry Vyukov <dvyukov@google.com>,
James Morse <james.morse@arm.com>, Michal Marek <mmarek@suse.com>
Subject: Re: [PATCHv3] kcov: reject open when kernel not instrumented
Date: Fri, 17 Jun 2016 16:53:19 +0100 [thread overview]
Message-ID: <20160617155319.GC32754@leverpostej> (raw)
In-Reply-To: <CAG_fn=W44UHQ8fgBxFBOAt0oAPr=Ob+SfTBLUrVfOdLUSL2DEw@mail.gmail.com>
On Fri, Jun 17, 2016 at 05:46:38PM +0200, Alexander Potapenko wrote:
> On Fri, Jun 17, 2016 at 5:42 PM, Kees Cook <keescook@chromium.org> wrote:
> > On Fri, Jun 17, 2016 at 2:39 AM, Mark Rutland <mark.rutland@arm.com> wrote:
> >> If the toolchain does not support -fsanitize-coverage=trace-pc, we blat
> >> this option from CFLAGS_KCOV, and build the kernel without
> >> instrumentation, even if CONFIG_KCOV was selected. However, we still
> >> build the rest of the kcov infrastructure, and expose a kcov file under
> >> debugfs. This can be confusing, as the kernel will appear to support
> >> kcov, yet will never manage to sample any trace PC values. While we do
> >> note this fact at build time, this may be missed, and a user may not
> >> have access to build logs.
> >
> > Do you want to refuse to build if the compiler doesn't support the
> > flag? I finally figured out how to do this, I think, for
> > -fstack-protector:
> >
> > http://git.kernel.org/cgit/linux/kernel/git/kees/linux.git/commit/?h=kbuild/stackprotector&id=600c1bd5f8647a8470dc2fc5a8697e3eafb5fd52
> >
> > If you wanted, the CONFIG_KCOV test could live under the same
> > prepare-compiler-check target.
> >
> > -Kees
> >
> I suspect the intention here is not to abort the build, but to have an
> opportunity to report at run time that the kernel has been built
> without kcov support.
My concern was that it was easy to miss the build-time warning, and
having the kcov file visible and accessible didn't make clear to the
user that the feature won't actually work.
I'm happy for a failed kcov_open or anything stronger than that (e.g.
the kcov file not bring present, or the build being aborted).
Thanks,
Mark.
next prev parent reply other threads:[~2016-06-17 15:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 9:39 [PATCHv3] kcov: reject open when kernel not instrumented Mark Rutland
2016-06-17 15:42 ` Kees Cook
2016-06-17 15:46 ` Alexander Potapenko
2016-06-17 15:53 ` Mark Rutland [this message]
2016-06-17 15:48 ` Mark Rutland
2016-06-17 15:51 ` Dmitry Vyukov
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=20160617155319.GC32754@leverpostej \
--to=mark.rutland@arm.com \
--cc=akpm@linux-foundation.org \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=james.morse@arm.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.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;
as well as URLs for NNTP newsgroup(s).