GitHub/LineageOS/android_kernel_motorola_exynos9610.git
7 years agoCONFIG_ARCH_HAS_RAW_COPY_USER is unconditional now
Al Viro [Wed, 5 Apr 2017 23:15:53 +0000 (19:15 -0400)]
CONFIG_ARCH_HAS_RAW_COPY_USER is unconditional now

all architectures converted

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoMerge branches 'uaccess.alpha', 'uaccess.arc', 'uaccess.arm', 'uaccess.arm64', 'uacce...
Al Viro [Wed, 26 Apr 2017 16:06:59 +0000 (12:06 -0400)]
Merge branches 'uaccess.alpha', 'uaccess.arc', 'uaccess.arm', 'uaccess.arm64', 'uaccess.avr32', 'uaccess.bfin', 'uaccess.c6x', 'uaccess.cris', 'uaccess.frv', 'uaccess.h8300', 'uaccess.hexagon', 'uaccess.ia64', 'uaccess.m32r', 'uaccess.m68k', 'uaccess.metag', 'uaccess.microblaze', 'uaccess.mips', 'uaccess.mn10300', 'uaccess.nios2', 'uaccess.openrisc', 'uaccess.parisc', 'uaccess.powerpc', 'uaccess.s390', 'uaccess.score', 'uaccess.sh', 'uaccess.sparc', 'uaccess.tile', 'uaccess.um', 'uaccess.unicore32', 'uaccess.x86' and 'uaccess.xtensa' into work.uaccess

7 years agom32r: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 16:02:25 +0000 (12:02 -0400)]
m32r: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agohexagon: switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 05:28:09 +0000 (01:28 -0400)]
hexagon: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomicroblaze: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 16:10:12 +0000 (12:10 -0400)]
microblaze: switch to RAW_COPY_USER

[kudos to Piotr Sroka for spotting a braino in the previous variant]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoget rid of padding, switch to RAW_COPY_USER
Al Viro [Wed, 5 Apr 2017 22:56:55 +0000 (18:56 -0400)]
get rid of padding, switch to RAW_COPY_USER

Merced is fucked, so what else is new?

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoia64: get rid of copy_in_user()
Al Viro [Tue, 28 Mar 2017 21:29:42 +0000 (17:29 -0400)]
ia64: get rid of copy_in_user()

it hadn't been biarch for years

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoia64: sanitize __access_ok()
Al Viro [Tue, 27 Dec 2016 15:29:34 +0000 (10:29 -0500)]
ia64: sanitize __access_ok()

turn into static inline, kill the 'segment' argument.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoia64: get rid of 'segment' argument of __do_{get,put}_user()
Al Viro [Tue, 27 Dec 2016 15:21:09 +0000 (10:21 -0500)]
ia64: get rid of 'segment' argument of __do_{get,put}_user()

it's only evaluated if the first argument is not 0, and in those
cases it's always equal to get_fs()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoia64: get rid of 'segment' argument of __{get,put}_user_check()
Al Viro [Tue, 27 Dec 2016 15:19:22 +0000 (10:19 -0500)]
ia64: get rid of 'segment' argument of __{get,put}_user_check()

always equal to get_fs()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoia64: add extable.h
Al Viro [Sun, 25 Dec 2016 19:24:35 +0000 (14:24 -0500)]
ia64: add extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoMerge commit 'b4fb8f66f1ae2e167d06c12d018025a8d4d3ba7e' into uaccess.ia64
Al Viro [Thu, 6 Apr 2017 23:35:03 +0000 (19:35 -0400)]
Merge commit 'b4fb8f66f1ae2e167d06c12d018025a8d4d3ba7e' into uaccess.ia64

backmerge of mainline ia64 fix

7 years agopowerpc: get rid of zeroing, switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 20:35:08 +0000 (16:35 -0400)]
powerpc: get rid of zeroing, switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoMerge commit 'a7d2475af7aedcb9b5c6343989a8bfadbf84429b' into uaccess.powerpc
Al Viro [Thu, 6 Apr 2017 19:08:10 +0000 (15:08 -0400)]
Merge commit 'a7d2475af7aedcb9b5c6343989a8bfadbf84429b' into uaccess.powerpc

backmerge of sorting the arch/powerpc/Kconfig

7 years agoesas2r: don't open-code memdup_user()
Al Viro [Thu, 30 Mar 2017 16:27:21 +0000 (12:27 -0400)]
esas2r: don't open-code memdup_user()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoalpha: fix stack smashing in old_adjtimex(2)
Al Viro [Sat, 25 Mar 2017 04:43:43 +0000 (00:43 -0400)]
alpha: fix stack smashing in old_adjtimex(2)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agodon't open-code kernel_setsockopt()
Al Viro [Sun, 19 Mar 2017 01:20:27 +0000 (21:20 -0400)]
don't open-code kernel_setsockopt()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomips: switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 19:59:26 +0000 (15:59 -0400)]
mips: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomips: get rid of tail-zeroing in primitives
Al Viro [Mon, 20 Mar 2017 16:03:16 +0000 (12:03 -0400)]
mips: get rid of tail-zeroing in primitives

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomips: make copy_from_user() zero tail explicitly
Al Viro [Mon, 20 Mar 2017 15:54:21 +0000 (11:54 -0400)]
mips: make copy_from_user() zero tail explicitly

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomips: clean and reorder the forest of macros...
Al Viro [Mon, 20 Mar 2017 15:51:34 +0000 (11:51 -0400)]
mips: clean and reorder the forest of macros...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomips: consolidate __invoke_... wrappers
Al Viro [Mon, 20 Mar 2017 15:40:15 +0000 (11:40 -0400)]
mips: consolidate __invoke_... wrappers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomips: sanitize __access_ok()
Al Viro [Tue, 27 Dec 2016 15:10:53 +0000 (10:10 -0500)]
mips: sanitize __access_ok()

for one thing, the last argument is always __access_mask and had been such
since 2.4.0-test3pre8; for another, it can bloody well be a static inline -
-O2 or -Os, __builtin_constant_p() propagates through static inline calls.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoMerge commit 'fc69910f329d' into uaccess.mips
Al Viro [Thu, 6 Apr 2017 06:07:33 +0000 (02:07 -0400)]
Merge commit 'fc69910f329d' into uaccess.mips

backmerge of a build fix from mainline

7 years agometag/usercopy: Switch to RAW_COPY_USER
James Hogan [Tue, 4 Apr 2017 14:46:52 +0000 (15:46 +0100)]
metag/usercopy: Switch to RAW_COPY_USER

Switch to using raw user copy instead of providing metag specific
[__]copy_{to,from}_user[_inatomic](). This simplifies the metag
uaccess.h and allows us to take advantage of extra checking in the
generic versions.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag...
Al Viro [Wed, 5 Apr 2017 15:41:09 +0000 (11:41 -0400)]
Merge branch 'fixes' of git://git./linux/kernel/git/jhogan/metag into uaccess.metag

7 years agometag/usercopy: Add missing fixups
James Hogan [Tue, 4 Apr 2017 07:51:34 +0000 (08:51 +0100)]
metag/usercopy: Add missing fixups

The rapf copy loops in the Meta usercopy code is missing some extable
entries for HTP cores with unaligned access checking enabled, where
faults occur on the instruction immediately after the faulting access.

Add the fixup labels and extable entries for these cases so that corner
case user copy failures don't cause kernel crashes.

Fixes: 373cd784d0fc ("metag: Memory handling")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Cc: stable@vger.kernel.org
7 years agometag/usercopy: Fix src fixup in from user rapf loops
James Hogan [Mon, 3 Apr 2017 16:41:40 +0000 (17:41 +0100)]
metag/usercopy: Fix src fixup in from user rapf loops

The fixup code to rewind the source pointer in
__asm_copy_from_user_{32,64}bit_rapf_loop() always rewound the source by
a single unit (4 or 8 bytes), however this is insufficient if the fault
didn't occur on the first load in the loop, as the source pointer will
have been incremented but nothing will have been stored until all 4
register [pairs] are loaded.

Read the LSM_STEP field of TXSTATUS (which is already loaded into a
register), a bit like the copy_to_user versions, to determine how many
iterations of MGET[DL] have taken place, all of which need rewinding.

Fixes: 373cd784d0fc ("metag: Memory handling")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Cc: stable@vger.kernel.org
7 years agometag/usercopy: Set flags before ADDZ
James Hogan [Tue, 4 Apr 2017 10:43:26 +0000 (11:43 +0100)]
metag/usercopy: Set flags before ADDZ

The fixup code for the copy_to_user rapf loops reads TXStatus.LSM_STEP
to decide how far to rewind the source pointer. There is a special case
for the last execution of an MGETL/MGETD, since it leaves LSM_STEP=0
even though the number of MGETLs/MGETDs attempted was 4. This uses ADDZ
which is conditional upon the Z condition flag, but the AND instruction
which masked the TXStatus.LSM_STEP field didn't set the condition flags
based on the result.

Fix that now by using ANDS which does set the flags, and also marking
the condition codes as clobbered by the inline assembly.

Fixes: 373cd784d0fc ("metag: Memory handling")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Cc: stable@vger.kernel.org
7 years agometag/usercopy: Zero rest of buffer from copy_from_user
James Hogan [Fri, 31 Mar 2017 10:14:02 +0000 (11:14 +0100)]
metag/usercopy: Zero rest of buffer from copy_from_user

Currently we try to zero the destination for a failed read from userland
in fixup code in the usercopy.c macros. The rest of the destination
buffer is then zeroed from __copy_user_zeroing(), which is used for both
copy_from_user() and __copy_from_user().

Unfortunately we fail to zero in the fixup code as D1Ar1 is set to 0
before the fixup code entry labels, and __copy_from_user() shouldn't even
be zeroing the rest of the buffer.

Move the zeroing out into copy_from_user() and rename
__copy_user_zeroing() to raw_copy_from_user() since it no longer does
any zeroing. This also conveniently matches the name needed for
RAW_COPY_USER support in a later patch.

Fixes: 373cd784d0fc ("metag: Memory handling")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Cc: stable@vger.kernel.org
7 years agometag/usercopy: Add early abort to copy_to_user
James Hogan [Fri, 31 Mar 2017 12:35:01 +0000 (13:35 +0100)]
metag/usercopy: Add early abort to copy_to_user

When copying to userland on Meta, if any faults are encountered
immediately abort the copy instead of continuing on and repeatedly
faulting, and worse potentially copying further bytes successfully to
subsequent valid pages.

Fixes: 373cd784d0fc ("metag: Memory handling")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Cc: stable@vger.kernel.org
7 years agometag/usercopy: Fix alignment error checking
James Hogan [Fri, 31 Mar 2017 10:23:18 +0000 (11:23 +0100)]
metag/usercopy: Fix alignment error checking

Fix the error checking of the alignment adjustment code in
raw_copy_from_user(), which mistakenly considers it safe to skip the
error check when aligning the source buffer on a 2 or 4 byte boundary.

If the destination buffer was unaligned it may have started to copy
using byte or word accesses, which could well be at the start of a new
(valid) source page. This would result in it appearing to have copied 1
or 2 bytes at the end of the first (invalid) page rather than none at
all.

Fixes: 373cd784d0fc ("metag: Memory handling")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Cc: stable@vger.kernel.org
7 years agometag/usercopy: Drop unused macros
James Hogan [Fri, 31 Mar 2017 09:37:44 +0000 (10:37 +0100)]
metag/usercopy: Drop unused macros

Metag's lib/usercopy.c has a bunch of copy_from_user macros for larger
copies between 5 and 16 bytes which are completely unused. Before fixing
zeroing lets drop these macros so there is less to fix.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-metag@vger.kernel.org
Cc: stable@vger.kernel.org
7 years agoxtensa: fix prefetch in the raw_copy_to_user
Max Filippov [Tue, 4 Apr 2017 20:26:29 +0000 (13:26 -0700)]
xtensa: fix prefetch in the raw_copy_to_user

'from' is the input buffer, it should be prefetched with prefetch, not
prefetchw.

Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agosparc: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 21:04:45 +0000 (17:04 -0400)]
sparc: switch to RAW_COPY_USER

... and drop zeroing in sparc32.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoparisc: switch to RAW_COPY_USER
Al Viro [Sat, 25 Mar 2017 03:11:26 +0000 (23:11 -0400)]
parisc: switch to RAW_COPY_USER

... and remove dead declarations, while we are at it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoMerge branch 'parisc-4.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
Al Viro [Sun, 2 Apr 2017 14:33:48 +0000 (10:33 -0400)]
Merge branch 'parisc-4.11-3' of git://git./linux/kernel/git/deller/parisc-linux into uaccess.parisc

7 years agos390: get rid of zeroing, switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 19:06:24 +0000 (15:06 -0400)]
s390: get rid of zeroing, switch to RAW_COPY_USER

[folded a fix from Martin]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoARC: uaccess: enable INLINE_COPY_{TO,FROM}_USER ...
Vineet Gupta [Wed, 29 Mar 2017 18:53:33 +0000 (11:53 -0700)]
ARC: uaccess: enable INLINE_COPY_{TO,FROM}_USER ...

... and switch to generic out of line version in lib/usercopy.c

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoparisc: Avoid stalled CPU warnings after system shutdown
Helge Deller [Wed, 29 Mar 2017 06:25:30 +0000 (08:25 +0200)]
parisc: Avoid stalled CPU warnings after system shutdown

Commit 73580dac7618 ("parisc: Fix system shutdown halt") introduced an endless
loop for systems which don't provide a software power off function.  But the
soft lockup detector will detect this and report stalled CPUs after some time.
Avoid those unwanted warnings by disabling the soft lockup detector.

Fixes: 73580dac7618 ("parisc: Fix system shutdown halt")
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # 4.9+
7 years agoparisc: Clean up fixup routines for get_user()/put_user()
Helge Deller [Sat, 25 Mar 2017 10:59:15 +0000 (11:59 +0100)]
parisc: Clean up fixup routines for get_user()/put_user()

Al Viro noticed that userspace accesses via get_user()/put_user() can be
simplified a lot with regard to usage of the exception handling.

This patch implements a fixup routine for get_user() and put_user() in such
that the exception handler will automatically load -EFAULT into the register
%r8 (the error value) in case on a fault on userspace.  Additionally the fixup
routine will zero the target register on fault in case of a get_user() call.
The target register is extracted out of the faulting assembly instruction.

This patch brings a few benefits over the old implementation:
1. Exception handling gets much cleaner, easier and smaller in size.
2. Helper functions like fixup_get_user_skip_1 (all of fixup.S) can be dropped.
3. No need to hardcode %r9 as target register for get_user() any longer. This
   helps the compiler register allocator and thus creates less assembler
   statements.
4. No dependency on the exception_data contents any longer.
5. Nested faults will be handled cleanly.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: Helge Deller <deller@gmx.de>
7 years agoparisc: Fix access fault handling in pa_memcpy()
Helge Deller [Wed, 29 Mar 2017 19:41:05 +0000 (21:41 +0200)]
parisc: Fix access fault handling in pa_memcpy()

pa_memcpy() is the major memcpy implementation in the parisc kernel which is
used to do any kind of userspace/kernel memory copies.

Al Viro noticed various bugs in the implementation of pa_mempcy(), most notably
that in case of faults it may report back to have copied more bytes than it
actually did.

Fixing those bugs is quite hard in the C-implementation, because the compiler
is messing around with the registers and we are not guaranteed that specific
variables are always in the same processor registers. This makes proper fault
handling complicated.

This patch implements pa_memcpy() in assembler. That way we have correct fault
handling and adding a 64-bit copy routine was quite easy.

Runtime tested with 32- and 64bit kernels.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
7 years agox86: switch to RAW_COPY_USER
Al Viro [Sat, 25 Mar 2017 23:33:21 +0000 (19:33 -0400)]
x86: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agox86: don't wank with magical size in __copy_in_user()
Al Viro [Sat, 25 Mar 2017 23:38:23 +0000 (19:38 -0400)]
x86: don't wank with magical size in __copy_in_user()

... especially since copy_in_user() doesn't

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoarc: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 12:19:02 +0000 (08:19 -0400)]
arc: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoxtensa: get rid of zeroing, use RAW_COPY_USER
Al Viro [Wed, 22 Mar 2017 17:02:41 +0000 (13:02 -0400)]
xtensa: get rid of zeroing, use RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoxtensa: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 19:34:44 +0000 (14:34 -0500)]
xtensa: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agokill __copy_from_user_nocache()
Al Viro [Sat, 25 Mar 2017 22:47:28 +0000 (18:47 -0400)]
kill __copy_from_user_nocache()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agounicore32: get rid of zeroing and switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 05:37:07 +0000 (01:37 -0400)]
unicore32: get rid of zeroing and switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoamd64: get rid of zeroing
Al Viro [Sat, 25 Mar 2017 22:36:22 +0000 (18:36 -0400)]
amd64: get rid of zeroing

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoum: switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 05:33:09 +0000 (01:33 -0400)]
um: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agotile: get rid of zeroing, switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 18:27:36 +0000 (14:27 -0400)]
tile: get rid of zeroing, switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agotile: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
tile: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agosparc32: kill __ret_efault()
Al Viro [Mon, 26 Dec 2016 01:27:33 +0000 (20:27 -0500)]
sparc32: kill __ret_efault()

it's unused on 32bit one as well...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agosh: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 18:43:13 +0000 (14:43 -0400)]
sh: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agosh: switch to extable.h
Al Viro [Sun, 25 Dec 2016 19:49:42 +0000 (14:49 -0500)]
sh: switch to extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoscore: switch to RAW_COPY_USER
Al Viro [Wed, 22 Mar 2017 17:26:57 +0000 (13:26 -0400)]
score: switch to RAW_COPY_USER

... and kill copy_in_user() - it's not a biarch architecture, to start with

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoscore: it's "VERIFY_WRITE", not "VERFITY_WRITE"...
Al Viro [Tue, 27 Dec 2016 19:50:40 +0000 (14:50 -0500)]
score: it's "VERIFY_WRITE", not "VERFITY_WRITE"...

... and the only reason it worked is that access_ok() discards the
first argument before parser even gets a chance of looking at it.
Still, no point keeping that typo.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoscore: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
score: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agos390: switch to extable.h
Al Viro [Mon, 26 Dec 2016 05:48:37 +0000 (00:48 -0500)]
s390: switch to extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agopowerpc: switch to extable.h
Al Viro [Mon, 26 Dec 2016 05:50:06 +0000 (00:50 -0500)]
powerpc: switch to extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoopenrisc: switch to RAW_COPY_USER
Al Viro [Wed, 22 Mar 2017 17:13:15 +0000 (13:13 -0400)]
openrisc: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoopenrisc: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 19:34:44 +0000 (14:34 -0500)]
openrisc: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agonios2: switch to RAW_COPY_USER
Al Viro [Wed, 22 Mar 2017 17:08:32 +0000 (13:08 -0400)]
nios2: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agonios2: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
nios2: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomn10300: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 16:06:57 +0000 (12:06 -0400)]
mn10300: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomn10300: get rid of zeroing
Al Viro [Tue, 21 Mar 2017 00:45:41 +0000 (20:45 -0400)]
mn10300: get rid of zeroing

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomn10300: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
mn10300: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agomicroblaze: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 19:34:44 +0000 (14:34 -0500)]
microblaze: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agometag: kill verify_area()
Al Viro [Wed, 28 Dec 2016 06:26:29 +0000 (01:26 -0500)]
metag: kill verify_area()

Deprecated in 2.6.12, killed in 2.6.13.  Time to end that depravity,
let's bury the body...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agometag: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
metag: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agom68k: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 12:50:56 +0000 (08:50 -0400)]
m68k: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agom68k: get rid of zeroing
Al Viro [Mon, 20 Mar 2017 04:55:24 +0000 (00:55 -0400)]
m68k: get rid of zeroing

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agom68k: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 19:33:17 +0000 (14:33 -0500)]
m68k: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agom32r: get rid of zeroing
Al Viro [Sun, 19 Mar 2017 20:11:13 +0000 (16:11 -0400)]
m32r: get rid of zeroing

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agom32r: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
m32r: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years ago8300: switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 05:22:03 +0000 (01:22 -0400)]
8300: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agofrv: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 12:46:17 +0000 (08:46 -0400)]
frv: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agofrv: switch to use of fixup_exception()
Al Viro [Sun, 25 Dec 2016 19:12:18 +0000 (14:12 -0500)]
frv: switch to use of fixup_exception()

Massage frv search_exception_table() to
a) taking pt_regs pointer as explicit argument
b) updating ->pc on success
Simplifies callers a bit and allows to convert to generic extable.h,
while we are at it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agocris: switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 05:18:37 +0000 (01:18 -0400)]
cris: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agocris: rename __copy_user_zeroing to __copy_user_in
Al Viro [Sun, 19 Mar 2017 19:28:30 +0000 (15:28 -0400)]
cris: rename __copy_user_zeroing to __copy_user_in

... now that it doesn't zero anymore

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agocris: get rid of zeroing
Al Viro [Sun, 19 Mar 2017 19:25:35 +0000 (15:25 -0400)]
cris: get rid of zeroing

... the rest of it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agocris: get rid of zeroing in __asm_copy_from_user_N for N > 4
Al Viro [Sun, 19 Mar 2017 19:17:25 +0000 (15:17 -0400)]
cris: get rid of zeroing in __asm_copy_from_user_N for N > 4

only one user for those

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agocris: don't rely upon __copy_user_zeroing() zeroing the tail
Al Viro [Sun, 19 Mar 2017 19:07:21 +0000 (15:07 -0400)]
cris: don't rely upon __copy_user_zeroing() zeroing the tail

we want to get rid of it; unfortunately, it's tangled as hell, so
it'll take many steps, more's the pity.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agocris: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
cris: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoc6x: switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 05:11:14 +0000 (01:11 -0400)]
c6x: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoc6x: remove duplicate definition of __access_ok
Al Viro [Tue, 27 Dec 2016 19:16:16 +0000 (14:16 -0500)]
c6x: remove duplicate definition of __access_ok

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agobfin: switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 04:36:07 +0000 (00:36 -0400)]
bfin: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoblackfin: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
blackfin: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoavr32: switch to RAW_COPY_USER
Al Viro [Tue, 28 Mar 2017 20:03:51 +0000 (16:03 -0400)]
avr32: switch to RAW_COPY_USER

This one needs profiling; use of asm variant of access_ok() might have
been performance-critical.  Now copy_{to,from}_user() are using the
C variant.  I doubt that it's going to have visible effects, but
that needs to be experimentally verified.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoarm64: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 12:40:57 +0000 (08:40 -0400)]
arm64: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoavr32: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
avr32: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoarm64: add extable.h
Al Viro [Sun, 25 Dec 2016 19:00:03 +0000 (14:00 -0500)]
arm64: add extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoarm: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 12:23:33 +0000 (08:23 -0400)]
arm: switch to RAW_COPY_USER

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoarm: switch to generic extable.h
Al Viro [Sun, 25 Dec 2016 08:33:03 +0000 (03:33 -0500)]
arm: switch to generic extable.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoarc: get rid of unused declaration
Al Viro [Sun, 19 Mar 2017 05:01:53 +0000 (01:01 -0400)]
arc: get rid of unused declaration

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoalpha: switch to RAW_COPY_USER
Al Viro [Tue, 21 Mar 2017 12:13:02 +0000 (08:13 -0400)]
alpha: switch to RAW_COPY_USER

copy_{to,from}_user() uninlined.  We can go back to inlined variants,
if we want to...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoalpha: add a helper for emitting exception table entries
Al Viro [Tue, 7 Mar 2017 09:08:46 +0000 (04:08 -0500)]
alpha: add a helper for emitting exception table entries

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoalpha: kill the 'segment' argument of __access_ok()
Al Viro [Tue, 27 Dec 2016 07:26:32 +0000 (02:26 -0500)]
alpha: kill the 'segment' argument of __access_ok()

always equal to get_fs().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
7 years agoalpha: don't bother with __access_ok() in traps.c
Al Viro [Tue, 27 Dec 2016 07:23:46 +0000 (02:23 -0500)]
alpha: don't bother with __access_ok() in traps.c

we want to check that address is below TASK_SIZE; sure,
__access_ok(addr, 0, USER_DS) will do that, but it's more straightforward
to just spell it out and that way we can get rid of the damn 'segment'
argument of __access_ok().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>