linux_dsm_epyc7002/arch/powerpc/lib
Russell Currey ef296729b7 powerpc/lib: Refactor __patch_instruction() to use __put_user_asm()
__patch_instruction() is called in early boot, and uses
__put_user_size(), which includes the allow/prevent calls to enforce
KUAP, which could either be called too early, or in the Radix case,
forced to use "early_" versions of functions just to safely handle
this one case.

__put_user_asm() does not do this, and thus is safe to use both in
early boot, and later on since in this case it should only ever be
touching kernel memory.

__patch_instruction() was previously refactored to use
__put_user_size() in order to be able to return -EFAULT, which would
allow the kernel to patch instructions in userspace, which should
never happen. This has the functional change of causing faults on
userspace addresses if KUAP is turned on, which should never happen in
practice.

A future enhancement could be to double check the patch address is
definitely allowed to be tampered with by the kernel.

Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2019-04-21 23:06:02 +10:00
..
alloc.c treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
checksum_32.S
checksum_64.S
checksum_wrappers.c powerpc: Add a framework for Kernel Userspace Access Protection 2019-04-21 23:05:57 +10:00
code-patching.c powerpc/lib: Refactor __patch_instruction() to use __put_user_asm() 2019-04-21 23:06:02 +10:00
copy_32.S
copypage_64.S
copypage_power7.S
copyuser_64.S
copyuser_power7.S
crtsavres.S
div64.S
error-inject.c powerpc: Add support for function error injection 2018-10-20 13:26:43 +11:00
feature-fixups-test.S
feature-fixups.c powerpc/fsl: Add infrastructure to fixup branch predictor flush 2018-12-20 22:53:39 +11:00
hweight_64.S
ldstfp.S
locks.c
Makefile powerpc: sstep: Add tests for compute type instructions 2019-02-23 21:04:31 +11:00
mem_64.S
memcmp_32.S
memcmp_64.S powerpc/64: Fix memcmp reading past the end of src/dest 2019-03-25 23:33:26 +11:00
memcpy_64.S
memcpy_power7.S
pmem.c
quad.S
rheap.c
sstep.c powerpc sstep: Add support for modsd, modud instructions 2019-02-26 00:05:20 +11:00
string_32.S
string_64.S
string.S
strlen_32.S
test_emulate_step_exec_instr.S powerpc: sstep: Add tests for compute type instructions 2019-02-23 21:04:31 +11:00
test_emulate_step.c powerpc: sstep: Add tests for addc[.] instruction 2019-02-23 21:04:31 +11:00
vmx-helper.c
xor_vmx_glue.c
xor_vmx.c
xor_vmx.h