From: Clément Léger Date: Mon, 2 Jun 2025 19:39:15 +0000 (+0200) Subject: riscv: process: use unsigned int instead of unsigned long for put_user() X-Git-Tag: v6.16-rc1~18^2~1^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=020667d661f9be65167174d28a6eda7102f7293f;p=thirdparty%2Fkernel%2Flinux.git riscv: process: use unsigned int instead of unsigned long for put_user() The specification of prctl() for GET_UNALIGN_CTL states that the value is returned in an unsigned int * address passed as an unsigned long. Change the type to match that and avoid an unaligned access as well. Signed-off-by: Clément Léger Reviewed-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20250602193918.868962-3-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 7c244de77180..fe10e326f44e 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -57,7 +57,7 @@ int get_unalign_ctl(struct task_struct *tsk, unsigned long adr) if (!unaligned_ctl_available()) return -EINVAL; - return put_user(tsk->thread.align_ctl, (unsigned long __user *)adr); + return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr); } void __show_regs(struct pt_regs *regs)