* [PATCH] riscv; fix __user annotation in save_v_state()
@ 2023-11-23 14:27 Ben Dooks
2024-01-11 14:50 ` patchwork-bot+linux-riscv
0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2023-11-23 14:27 UTC (permalink / raw)
To: linux-riscv; +Cc: linux-kernel, paul.walmsley, palmer, aou, Ben Dooks
The save_v_state() is technically sending a __user pointer through
__put_user() and thus is generating a sparse warning so force the
value to be "void *" to fix:
arch/riscv/kernel/signal.c:94:16: warning: incorrect type in initializer (different address spaces)
arch/riscv/kernel/signal.c:94:16: expected void *__val
arch/riscv/kernel/signal.c:94:16: got void [noderef] __user *[assigned] datap
Fixes: 8ee0b41898fa26f66e32 ("riscv: signal: Add sigcontext save/restore for vector")
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
arch/riscv/kernel/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c
index 88b6220b2608..33dfb5078301 100644
--- a/arch/riscv/kernel/signal.c
+++ b/arch/riscv/kernel/signal.c
@@ -91,7 +91,7 @@ static long save_v_state(struct pt_regs *regs, void __user **sc_vec)
err = __copy_to_user(&state->v_state, ¤t->thread.vstate,
offsetof(struct __riscv_v_ext_state, datap));
/* Copy the pointer datap itself. */
- err |= __put_user(datap, &state->v_state.datap);
+ err |= __put_user((__force void *)datap, &state->v_state.datap);
/* Copy the whole vector content to user space datap. */
err |= __copy_to_user(datap, current->thread.vstate.datap, riscv_v_vsize);
/* Copy magic to the user space after saving all vector conetext */
--
2.37.2.352.g3c44437643
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] riscv; fix __user annotation in save_v_state()
2023-11-23 14:27 [PATCH] riscv; fix __user annotation in save_v_state() Ben Dooks
@ 2024-01-11 14:50 ` patchwork-bot+linux-riscv
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-01-11 14:50 UTC (permalink / raw)
To: Ben Dooks; +Cc: linux-riscv, linux-kernel, paul.walmsley, palmer, aou
Hello:
This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:
On Thu, 23 Nov 2023 14:27:08 +0000 you wrote:
> The save_v_state() is technically sending a __user pointer through
> __put_user() and thus is generating a sparse warning so force the
> value to be "void *" to fix:
>
> arch/riscv/kernel/signal.c:94:16: warning: incorrect type in initializer (different address spaces)
> arch/riscv/kernel/signal.c:94:16: expected void *__val
> arch/riscv/kernel/signal.c:94:16: got void [noderef] __user *[assigned] datap
> Fixes: 8ee0b41898fa26f66e32 ("riscv: signal: Add sigcontext save/restore for vector")
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>
> [...]
Here is the summary with links:
- riscv; fix __user annotation in save_v_state()
https://git.kernel.org/riscv/c/869436dae72a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-11 14:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-23 14:27 [PATCH] riscv; fix __user annotation in save_v_state() Ben Dooks
2024-01-11 14:50 ` patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox