summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorChangbin Du <changbin.du@gmail.com>2020-11-02 15:30:52 +0800
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-11-06 00:03:46 -0800
commit635e3f3e47f24b2506bc9daf91d70ddf3cd024a9 (patch)
tree190bfd65139ea47af92ae32608de28c1f7b7b73a /arch
parentbcacf5f6f239a9e60287680514f392748cb4ec39 (diff)
downloadlinux-stable-635e3f3e47f24b2506bc9daf91d70ddf3cd024a9.tar.gz
linux-stable-635e3f3e47f24b2506bc9daf91d70ddf3cd024a9.tar.bz2
linux-stable-635e3f3e47f24b2506bc9daf91d70ddf3cd024a9.zip
riscv: uaccess: fix __put_kernel_nofault()
The copy_from_kernel_nofault() is broken on riscv because the 'dst' and 'src' are mistakenly reversed in __put_kernel_nofault() macro. copy_to_kernel_nofault: ... 0xffffffe0003159b8 <+30>: sd a4,0(a1) # a1 aka 'src' Fixes: d464118cdc ("riscv: implement __get_kernel_nofault and __put_user_nofault") Signed-off-by: Changbin Du <changbin.du@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Anup Patel <anup@brainfault.org> Tested-by: Anup Patel <anup@brainfault.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/include/asm/uaccess.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uaccess.h
index c47e6b35c551..824b2c9da75b 100644
--- a/arch/riscv/include/asm/uaccess.h
+++ b/arch/riscv/include/asm/uaccess.h
@@ -476,7 +476,7 @@ do { \
do { \
long __kr_err; \
\
- __put_user_nocheck(*((type *)(dst)), (type *)(src), __kr_err); \
+ __put_user_nocheck(*((type *)(src)), (type *)(dst), __kr_err); \
if (unlikely(__kr_err)) \
goto err_label; \
} while (0)