From: Kees Cook <keescook@chromium.org>
To: Alexander Popov <alex.popov@linux.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, notify@kernel.org
Subject: Re: [PATCH v1 1/1] lkdtm/stackleak: Make the stack erasing test more verbose
Date: Mon, 30 Dec 2019 14:46:50 -0800 [thread overview]
Message-ID: <201912301443.9B8F6CA6@keescook> (raw)
In-Reply-To: <5bde4de0-875c-536b-67ec-eafebb8b9ab1@linux.com>
On Tue, Dec 31, 2019 at 01:20:24AM +0300, Alexander Popov wrote:
> Hello Kees!
>
> On 30.12.2019 21:37, Kees Cook wrote:
> > On Thu, Dec 19, 2019 at 05:54:16PM +0300, Alexander Popov wrote:
> >> Make the stack erasing test more verbose about the errors that it
> >> can detect. BUG() in case of test failure is useful when the test
> >> is running in a loop.
> >
> > Hi! I try to keep the "success" conditions for LKDTM tests to be a
> > system exception, so doing "BUG" on a failure is actually against the
> > design. So, really, a test harness needs to know to check dmesg for the
> > results here. It almost looks like this check shouldn't live in LKDTM,
>
> Hm, I see...
>
> Let me explain why I've decided to use BUG() in case of a failure.
>
> Once upon a time I noticed that the stack erasing test failed on a kernel with
> KASAN enabled. It happened only once, and all my numerous efforts to reproduce
> it failed. That's why I come with this patch. These changes provide additional
> information and allow easy detection of a failure when you run the test in a loop.
>
> Is stackleak test the only exception of this kind in LKDTM?
Some of the refcount_t tests don't trigger a WARN(), and there are
related benchmarking tests that don't either.
> > but since it feels like other LKDTM tests, I'm happy to keep it there
> > for now.
>
> Do you mean that you will apply this patch?
Sorry for my confusing reply! I meant that I don't want to apply the
patch, but I'm find to leave the stackleak check in LKDTM.
However, if you want to split it out into its own test, I think that
should be fine; similar to lib/test_user_copy.c if you want it to stand
alone and have its own semantics, etc.
> > I'll resend my selftests series that adds a real test harness for all
> > the LKDTM tests and CC you.
>
> Ok!
>
> Maybe you also see how to improve the LKDTM infrastructure and remove this
> inconsistency. Could you share your ideas?
I don't, unfortunately. The real "difficulty" is that some of the
crashes are architecture-specific (e.g. how MMU traps are reported
across different architectures), so it's not too easy to consolidate
the reporting. As a result, I've taken to trying to do best-effort on
the test running side. I'll send what I've got...
--
Kees Cook
next prev parent reply other threads:[~2019-12-30 22:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-19 14:54 [PATCH v1 1/1] lkdtm/stackleak: Make the stack erasing test more verbose Alexander Popov
2019-12-28 20:20 ` Alexander Popov
2019-12-30 18:37 ` Kees Cook
2019-12-30 22:20 ` Alexander Popov
2019-12-30 22:46 ` Kees Cook [this message]
2020-01-01 23:26 ` Alexander Popov
2020-01-02 22:03 ` Kees Cook
2020-01-02 22:37 ` Alexander Popov
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=201912301443.9B8F6CA6@keescook \
--to=keescook@chromium.org \
--cc=alex.popov@linux.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=notify@kernel.org \
/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