Kees Cook
f5509cc18d
mm: Hardened usercopy
...
This is the start of porting PAX_USERCOPY into the mainline kernel. This
is the first set of features, controlled by CONFIG_HARDENED_USERCOPY. The
work is based on code by PaX Team and Brad Spengler, and an earlier port
from Casey Schaufler. Additional non-slab page tests are from Rik van Riel.
This patch contains the logic for validating several conditions when
performing copy_to_user() and copy_from_user() on the kernel object
being copied to/from:
- address range doesn't wrap around
- address range isn't NULL or zero-allocated (with a non-zero copy size)
- if on the slab allocator:
- object size must be less than or equal to copy size (when check is
implemented in the allocator, which appear in subsequent patches)
- otherwise, object must not span page allocations (excepting Reserved
and CMA ranges)
- if on the stack
- object must not extend before/after the current process stack
- object must be contained by a valid stack frame (when there is
arch/build support for identifying stack frames)
- object must not overlap with kernel text
Signed-off-by: Kees Cook <keescook@chromium.org >
Tested-by: Valdis Kletnieks <valdis.kletnieks@vt.edu >
Tested-by: Michael Ellerman <mpe@ellerman.id.au >
2016-07-26 14:41:47 -07:00
..
2016-07-10 20:13:53 +02:00
2016-05-30 23:00:22 +02:00
2016-05-17 10:15:34 +05:30
2016-05-29 20:21:41 +01:00
2016-06-02 17:59:44 +01:00
2016-06-30 07:44:23 +01:00
2016-06-22 16:38:11 -04:00
2016-07-01 06:12:03 -04:00
2016-05-26 09:36:10 -07:00
2016-05-26 20:52:15 +02:00
2016-06-19 10:47:32 -07:00
2016-05-17 18:06:18 +01:00
2016-05-18 13:14:02 -07:00
2016-06-15 10:32:25 -04:00
2016-06-24 17:03:12 -07:00
2015-01-28 18:45:23 -05:00
2016-05-23 17:53:39 -07:00
2016-06-29 15:18:47 -07:00
2016-06-07 22:07:09 -04:00
2016-05-26 19:34:26 -07:00
2016-05-19 19:12:14 -07:00
2016-06-29 05:42:55 -04:00
2015-01-20 14:02:58 -07:00
2016-06-01 14:56:57 -07:00
2016-05-20 17:58:30 -07:00
2016-05-19 19:12:14 -07:00
2016-05-19 19:12:14 -07:00
2016-05-23 11:48:48 -07:00
2016-06-02 23:05:27 +02:00
2016-05-19 19:12:14 -07:00
2016-05-26 20:00:28 -07:00
2016-06-20 10:41:51 -07:00
2016-05-19 19:12:14 -07:00
2016-05-20 21:26:15 -07:00
2016-06-05 10:36:01 -07:00
2016-05-31 22:12:43 +05:30
2016-06-03 09:57:35 +02:00
2014-11-24 07:45:02 +01:00
2016-05-27 16:03:22 -07:00
2016-05-17 15:48:12 -04:00
2013-09-26 15:06:58 -07:00
2016-05-31 22:17:05 +05:30
2016-07-13 11:53:40 -07:00
2016-05-27 17:14:05 -07:00
2016-06-01 10:29:39 +02:00
2016-05-19 19:12:14 -07:00
2016-05-17 17:11:27 -07:00
2016-05-20 17:58:30 -07:00
2016-05-20 17:58:30 -07:00
2016-05-28 15:48:31 -04:00
2016-07-15 14:54:27 +09:00
2016-05-20 17:58:30 -07:00
2016-05-19 19:12:14 -07:00
2016-05-20 17:58:30 -07:00
2016-06-10 23:22:55 -07:00
2016-06-24 17:07:33 -07:00
2005-04-16 15:20:36 -07:00
2016-05-16 15:12:02 -05:00
2012-12-09 00:20:28 -05:00
2016-06-17 20:47:11 -07:00
2016-06-24 08:23:16 +02:00
2016-05-20 17:58:30 -07:00
2016-06-24 17:23:52 -07:00
2016-05-20 22:20:48 -07:00
2016-05-20 21:26:15 -07:00
2016-05-23 17:04:14 -07:00
2016-05-25 16:12:05 +02:00
2016-06-08 11:47:06 +02:00
2016-05-17 12:06:35 +02:00
2016-05-16 14:47:16 -07:00
2015-11-25 09:22:02 -07:00
2016-05-19 09:21:36 -07:00
2016-07-23 10:25:54 +09:00
2016-05-27 15:23:32 -07:00
2016-05-19 19:12:14 -07:00
2016-05-19 19:12:14 -07:00
2016-05-19 19:12:14 -07:00
2016-05-26 15:35:44 -07:00
2016-06-24 17:23:52 -07:00
2016-07-26 14:41:46 -07:00
2009-04-01 07:38:54 -04:00
2016-06-05 10:36:01 -07:00
2016-06-15 22:07:57 -07:00
2016-05-20 18:03:15 -04:00
2016-07-16 20:15:02 -07:00
2016-05-17 15:48:12 -04:00
2016-05-17 15:47:55 -04:00
2016-05-17 15:05:23 -07:00
2016-05-26 10:33:33 -07:00
2016-05-23 17:04:14 -07:00
2016-05-19 19:12:14 -07:00
2016-02-16 13:04:58 -05:00
2016-06-08 08:18:06 -05:00
2015-08-25 11:29:55 -05:00
2016-06-09 14:38:22 -05:00
2016-06-03 07:27:55 -05:00
2016-05-23 17:04:14 -07:00
2016-05-19 19:12:14 -07:00
2016-06-03 15:06:22 -07:00
2016-05-19 19:12:14 -07:00
2016-05-20 17:58:30 -07:00
2016-05-20 17:58:30 -07:00
2016-05-19 13:10:54 -07:00
2016-05-20 17:58:30 -07:00
2016-05-25 17:05:40 -07:00
2016-05-19 19:12:14 -07:00
2016-07-11 13:48:02 -04:00
2016-05-20 17:58:30 -07:00
2016-06-23 18:37:05 +02:00
2016-07-23 10:25:54 +09:00
2016-05-20 17:58:30 -07:00
2016-05-31 22:12:43 +05:30
2016-06-29 21:24:53 +02:00
2016-07-15 14:54:27 +09:00
2007-05-02 11:56:33 +01:00
2016-05-26 00:04:58 -04:00
2016-06-24 15:09:37 -07:00
2016-05-31 11:59:06 -07:00
2016-05-17 14:41:03 -07:00
2016-06-03 08:37:25 +02:00
2016-05-23 17:04:14 -07:00
2016-07-01 16:19:34 -04:00
2016-05-19 19:12:14 -07:00
2016-07-26 14:41:47 -07:00
2016-05-26 15:35:44 -07:00
2016-06-28 09:08:51 -04:00
2016-05-19 19:12:14 -07:00
2016-05-28 15:42:50 -04:00
2016-05-20 17:58:30 -07:00
2016-05-20 17:58:30 -07:00
2016-06-01 22:25:48 +08:00
2016-07-26 14:41:47 -07:00
2016-05-19 19:12:14 -07:00
2015-12-10 22:41:06 -08:00
2016-06-01 21:13:43 +02:00
2016-05-06 10:42:29 +02:00
2016-05-18 18:55:19 -07:00
2016-05-20 20:57:27 -07:00
2016-05-23 17:04:14 -07:00
2016-05-20 17:58:30 -07:00
2016-05-23 11:48:48 -07:00
2016-05-19 19:12:14 -07:00
2016-05-27 20:09:16 -04:00
2016-05-20 17:58:30 -07:00