[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhSdy12JRy5uF5t-e=bw=K1Gk5PKuTErg0kmKOxBKBn4MnhJw@mail.gmail.com>
Date: Fri, 6 Nov 2020 12:21:52 +0530
From: Anup Patel <anup@...infault.org>
To: Changbin Du <changbin.du@...il.com>,
Palmer Dabbelt <palmer@...belt.com>,
Palmer Dabbelt <palmerdabbelt@...gle.com>
Cc: Paul Walmsley <paul.walmsley@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-riscv <linux-riscv@...ts.infradead.org>,
"linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@....de>
Subject: Re: [PATCH] riscv: uaccess: fix __put_kernel_nofault()
On Mon, Nov 2, 2020 at 1:01 PM Changbin Du <changbin.du@...il.com> wrote:
>
> 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@...il.com>
> Cc: Christoph Hellwig <hch@....de>
> ---
> arch/riscv/include/asm/uaccess.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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)
> --
> 2.17.1
>
>
Looks good to me.
Tested-by: Anup Patel <anup@...infault.org>
Reviewed-by: Anup Patel <anup@...infault.org>
@Palmer Dabbelt , This patch fixes jump label implementation in
Linux-5.10-rc2. In general, this patch fixes all kernel instruction
patching related features. Can you take this for Linux-5.10-rcX ??
Regards,
Anup
Powered by blists - more mailing lists