Mark Rutland
bf90e56e46
lib: harden strncpy_from_user
...
The strncpy_from_user() accessor is effectively a copy_from_user()
specialised to copy strings, terminating early at a NUL byte if possible.
In other respects it is identical, and can be used to copy an arbitrarily
large buffer from userspace into the kernel. Conceptually, it exposes a
similar attack surface.
As with copy_from_user(), we check the destination range when the kernel
is built with KASAN, but unlike copy_from_user() we do not check the
destination buffer when using HARDENED_USERCOPY. As strncpy_from_user()
calls get_user() in a loop, we must call check_object_size() explicitly.
This patch adds this instrumentation to strncpy_from_user(), per the same
rationale as with the regular copy_from_user(). In the absence of
hardened usercopy this will have no impact as the instrumentation expands
to an empty static inline function.
Link: http://lkml.kernel.org/r/1472221903-31181-1-git-send-email-mark.rutland@arm.com
Signed-off-by: Mark Rutland <mark.rutland@arm.com >
Cc: Kees Cook <keescook@chromium.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2016-10-11 15:06:30 -07:00
..
2016-03-17 21:38:27 -07:00
2016-04-13 09:22:49 -07:00
2016-07-29 18:30:16 +08:00
2016-10-07 09:45:43 -07:00
2015-09-10 13:29:01 -07:00
2016-05-17 09:33:39 -07:00
2016-04-06 14:06:48 +01:00
2016-10-07 18:46:30 -07:00
locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
2016-06-16 10:48:32 +02:00
2014-12-13 12:42:51 -08:00
2016-07-15 10:26:30 +02:00
2014-12-22 16:43:06 +00:00
2015-11-23 09:44:58 +01:00
2016-03-17 15:09:34 -07:00
2016-07-03 00:57:23 -04:00
2016-03-13 23:55:13 -04:00
2015-05-27 15:22:15 +02:00
2016-09-19 21:44:31 +02:00
2016-02-29 09:35:20 +01:00
2016-08-02 19:35:08 -04:00
2015-05-26 15:26:43 +02:00
2015-05-30 22:42:24 -07:00
2015-06-11 15:08:32 +02:00
2016-05-19 19:12:14 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-07-17 16:39:54 -07:00
2016-02-07 23:17:59 -08:00
2016-05-31 16:42:00 +08:00
2015-11-16 14:42:12 -05:00
2016-10-06 17:13:54 -07:00
2016-08-04 08:50:07 -04:00
2016-02-05 18:10:40 -08:00
2016-08-04 08:50:07 -04:00
2015-02-12 18:54:15 -08:00
2016-06-08 11:04:19 +02:00
2016-02-24 14:57:26 +00:00
2015-10-23 17:55:10 +09:00
2015-04-17 09:03:54 -04:00
2016-02-15 11:18:23 +01:00
2016-05-20 17:58:30 -07:00
2015-02-13 21:21:35 -08:00
2015-12-22 17:10:18 -06:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2016-06-08 15:01:02 +02:00
2015-11-06 17:50:42 -08:00
2015-02-12 18:54:15 -08:00
2016-01-20 17:09:18 -08:00
2015-11-05 16:34:48 -08:00
2016-08-02 19:35:07 -04:00
2015-04-14 16:49:04 -07:00
2016-10-11 10:40:01 -07:00
2016-09-19 21:44:27 +02:00
2015-11-06 17:50:42 -08:00
2016-01-16 11:17:27 -08:00
2016-10-07 21:38:00 -07:00
2016-10-07 12:24:08 -07:00
2016-07-28 16:07:41 -07:00
2016-05-23 17:04:14 -07:00
2016-09-20 14:26:08 +02:00
2016-02-07 22:18:47 -08:00
2015-02-12 18:54:15 -08:00
2016-02-09 17:36:34 -08:00
2016-03-17 15:09:34 -07:00
2015-03-31 09:45:50 -06:00
2016-01-22 11:58:43 -08:00
2016-03-09 15:43:42 -08:00
2015-06-16 14:12:35 -04:00
2015-11-06 17:50:42 -08:00
2015-08-12 11:59:04 +02:00
2015-11-25 09:22:02 -07:00
2016-10-07 14:42:05 -07:00
2015-02-12 18:54:15 -08:00
2015-12-03 11:49:23 -05:00
2016-04-23 20:13:24 -04:00
2016-10-07 18:46:30 -07:00
2016-05-19 19:12:14 -07:00
2015-10-08 05:26:36 -07:00
2015-09-08 14:35:59 -07:00
2016-05-19 19:12:14 -07:00
2015-11-06 17:50:42 -08:00
2016-02-15 11:18:23 +01:00
2015-02-12 18:54:16 -08:00
2016-10-05 09:17:56 -07:00
2016-09-27 22:09:17 -04:00
2016-08-02 19:35:06 -04:00
2016-07-06 10:51:14 +01:00
2016-09-20 04:43:36 -04:00
2016-09-19 08:19:40 -06:00
2016-02-08 10:15:17 -08:00
2015-12-23 14:27:20 -05:00
2016-04-15 16:53:14 -04:00
2015-08-24 14:28:01 -06:00
2015-03-23 22:12:08 -04:00
2015-09-08 15:35:28 -07:00
2015-06-25 17:00:40 -07:00
2016-07-28 16:07:41 -07:00
2015-02-12 18:54:16 -08:00
2016-04-21 10:47:26 +10:00
2016-03-17 15:09:34 -07:00
2016-10-11 15:06:30 -07:00
2016-08-08 13:02:01 -07:00
2016-08-04 08:50:07 -04:00
2016-09-16 09:18:53 +02:00
2016-02-19 22:54:09 -05:00
2016-09-15 19:17:15 -04:00
2016-01-07 13:44:22 -07:00
2016-09-01 17:52:01 -07:00
2016-01-20 17:09:18 -08:00
2016-05-20 17:58:30 -07:00
2016-03-15 16:55:16 -07:00
2016-08-08 12:52:42 -07:00
2015-08-03 11:51:12 +02:00
2016-02-09 10:27:29 +01:00
2016-05-30 15:26:57 -07:00
2015-09-10 13:29:01 -07:00
2016-02-03 08:28:43 -08:00
2015-04-22 17:06:49 +02:00
2016-08-02 17:31:41 -04:00
2016-01-20 17:09:18 -08:00
2016-09-09 16:08:46 +01:00
2016-05-30 15:26:57 -07:00
2016-05-20 17:58:30 -07:00
2016-09-21 00:22:59 -04:00