diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-09 02:33:51 +0200 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2018-06-09 21:34:31 +0200 |
commit | 86406d51d3600bfa2b6f86e1e6bfce712bec0d53 (patch) | |
tree | 377b5f849722635bc2e919a4a7176da05d7859d0 /arch/riscv/kernel/riscv_ksyms.c | |
parent | riscv: no __user for probe_kernel_address() (diff) | |
download | linux-86406d51d3600bfa2b6f86e1e6bfce712bec0d53.tar.xz linux-86406d51d3600bfa2b6f86e1e6bfce712bec0d53.zip |
riscv: split the declaration of __copy_user
We use a single __copy_user assembly function to copy memory both from
and to userspace. While this works, it triggers sparse errors because
we're implicitly casting between the kernel and user address spaces by
calling __copy_user.
This patch splits the C declaration into a pair of functions,
__asm_copy_{to,from}_user, that have sane semantics WRT __user. This
split make things fine from sparse's point of view. The assembly
implementation keeps a single definition but add a double ENTRY() for it,
one for __asm_copy_to_user and another one for __asm_copy_from_user.
The result is a spare-safe implementation that pays no performance
or code size penalty.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv/kernel/riscv_ksyms.c')
-rw-r--r-- | arch/riscv/kernel/riscv_ksyms.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/riscv/kernel/riscv_ksyms.c b/arch/riscv/kernel/riscv_ksyms.c index 551734248748..f247d6d2137c 100644 --- a/arch/riscv/kernel/riscv_ksyms.c +++ b/arch/riscv/kernel/riscv_ksyms.c @@ -13,6 +13,7 @@ * Assembly functions that may be used (directly or indirectly) by modules */ EXPORT_SYMBOL(__clear_user); -EXPORT_SYMBOL(__copy_user); +EXPORT_SYMBOL(__asm_copy_to_user); +EXPORT_SYMBOL(__asm_copy_from_user); EXPORT_SYMBOL(memset); EXPORT_SYMBOL(memcpy); |