[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20131203134701.e3bc01aa8b20bddfb73f53c6@linux-foundation.org>
Date: Tue, 3 Dec 2013 13:47:01 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Kees Cook <keescook@...omium.org>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
David Howells <dhowells@...hat.com>,
Rusty Russell <rusty@...tcorp.com.au>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [PATCH 2/2] test: check copy_to/from_user boundary validation
On Tue, 3 Dec 2013 13:27:34 -0800 Kees Cook <keescook@...omium.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists