H. Peter Anvin c41d68a513 compat: Make compat_alloc_user_space() incorporate the access_ok()
compat_alloc_user_space() expects the caller to independently call
access_ok() to verify the returned area.  A missing call could
introduce problems on some architectures.

This patch incorporates the access_ok() check into
compat_alloc_user_space() and also adds a sanity check on the length.
The existing compat_alloc_user_space() implementations are renamed
arch_compat_alloc_user_space() and are used as part of the
implementation of the new global function.

This patch assumes NULL will cause __get_user()/__put_user() to either
fail or access userspace on all architectures.  This should be
followed by checking the return value of compat_access_user_space()
for NULL in the callers, at which time the access_ok() in the callers
can also be removed.

Reported-by: Ben Hawkes <hawkes@sota.gen.nz>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Tony Luck <tony.luck@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: James Bottomley <jejb@parisc-linux.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: <stable@kernel.org>
2010-09-14 16:08:45 -07:00
..
2010-08-05 13:26:20 +01:00
2010-08-12 06:38:24 +10:00
2010-09-08 10:50:00 -06:00
2010-06-04 16:00:42 -04:00
2010-06-15 09:56:01 +10:00
2010-05-27 09:12:53 -07:00
2010-08-12 08:43:30 -07:00
2010-08-12 08:43:30 -07:00
2010-08-12 08:43:30 -07:00
2010-06-24 21:30:09 -07:00
2010-08-18 01:09:01 -04:00
2010-09-09 18:57:23 -07:00
2010-08-06 15:36:47 -05:00
2010-08-04 11:00:45 +02:00
2010-08-12 04:14:05 +01:00
2010-08-18 08:35:46 -04:00
2010-08-18 08:35:48 -04:00
2010-07-12 14:41:40 +02:00
2010-05-25 08:07:01 -07:00
2010-05-21 09:34:29 -07:00
2010-07-19 11:54:16 +02:00
2010-08-11 09:23:22 +02:00
2010-08-11 18:21:02 +02:00
2010-06-16 18:08:13 +02:00
2010-06-03 03:21:52 -07:00
2010-06-23 13:16:38 -07:00
2010-08-09 20:45:05 -07:00
2010-06-22 08:07:01 +02:00
2010-06-03 03:21:52 -07:00
2010-08-10 11:49:21 -07:00
2010-08-12 11:27:58 +02:00
2010-05-21 09:37:29 -07:00
2010-09-09 18:57:24 -07:00
2010-06-29 10:07:09 +02:00
2010-08-02 06:39:44 +03:00
2010-08-01 10:47:00 +03:00
2010-07-06 13:45:24 -04:00
2010-06-16 18:03:15 +02:00
2010-08-09 16:48:45 -04:00
2010-07-14 17:14:00 +10:00
2010-06-03 03:21:52 -07:00
2010-09-09 09:05:06 -07:00
2010-08-11 00:29:47 -04:00
2010-06-03 03:21:52 -07:00
2010-07-02 21:59:08 -07:00
2010-07-05 16:14:52 -06:00
2010-07-05 16:14:25 -06:00
2010-07-31 19:53:06 +08:00
2010-07-19 01:58:48 +02:00
2010-07-19 01:58:48 +02:00
2010-08-04 21:53:17 -07:00
2010-06-03 03:21:52 -07:00
2010-08-09 16:47:27 -04:00
2010-05-27 09:12:50 -07:00
2010-05-30 09:02:47 -07:00
2010-07-22 13:46:21 -07:00
2010-07-23 17:08:41 +04:00
2010-06-03 03:21:52 -07:00
2010-09-08 15:04:10 +02:00
2010-05-25 11:41:43 -04:00
2010-06-16 14:55:35 -07:00
2010-08-09 16:48:44 -04:00
2010-08-18 08:35:47 -04:00
2010-08-06 10:37:02 -04:00
2010-08-11 08:59:02 -07:00
2010-06-03 03:21:52 -07:00