From: Andrew Morton <akpm@linux-foundation.org>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
David Howells <dhowells@redhat.com>,
Rusty Russell <rusty@rustcorp.com.au>,
Dave Hansen <dave.hansen@linux.intel.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH 2/2] test: check copy_to/from_user boundary validation
Date: Tue, 3 Dec 2013 13:47:01 -0800 [thread overview]
Message-ID: <20131203134701.e3bc01aa8b20bddfb73f53c6@linux-foundation.org> (raw)
In-Reply-To: <1386106054-27636-3-git-send-email-keescook@chromium.org>
On Tue, 3 Dec 2013 13:27:34 -0800 Kees Cook <keescook@chromium.org> wrote:
> To help avoid an architecture failing to correctly check kernel/user
> boundaries when handling copy_to_user, copy_from_user, put_user, or
> get_user, perform some simple tests and fail to load if any of them
> behave unexpectedly.
>
> Specifically, this is to make sure there is a way to notice if things
> like what was fixed in 8404663f81d212918ff85f493649a7991209fa04 ("ARM:
> 7527/1: uaccess: explicitly check __user pointer when !CPU_USE_DOMAINS")
> ever regresses again, for any architecture.
I guess the challenge will be to get anyone to remember to run this.
Really, this could be viewed as a candidate for
tools/testing/selftests. The tests in there are userspace tests, and
your userspace test would consist of "modprobe test_user_copy". The
advantage of this is that your test will get included whenever someone
runs the selftest suite. This is better than having it stranded over
in ./kernel/.
> ---
> kernel/Makefile | 1 +
> kernel/test_user_copy.c | 103 +++++++++++++++++++++++++++++++++++++++++++++++
> lib/Kconfig.debug | 13 ++++++
We already have a whole pile of test modules - seven of them reside in
lib/ and I think there's an RCU one somewhere. Can we bring order to
all of this? Some form of integration under tools/testing would be one
approach.
If you're disinclined to undertake such a project at this time, I'd
suggest these two go into lib/ so they are known about if/when someone
goes for the big cleanup.
next prev parent reply other threads:[~2013-12-03 21:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 21:27 [PATCH 0/2] test modules Kees Cook
2013-12-03 21:27 ` [PATCH 1/2] test: add minimal module for verification testing Kees Cook
2013-12-03 21:36 ` Andrew Morton
2013-12-03 23:52 ` Rusty Russell
2013-12-03 21:27 ` [PATCH 2/2] test: check copy_to/from_user boundary validation Kees Cook
2013-12-03 21:47 ` Andrew Morton [this message]
2013-12-03 22:03 ` Kees Cook
2013-12-03 21:53 ` Joe Perches
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=20131203134701.e3bc01aa8b20bddfb73f53c6@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dave.hansen@linux.intel.com \
--cc=dhowells@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=rusty@rustcorp.com.au \
/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
all inboxes | Powered by JetHome®