* Re: [PATCH] riscv: signal: fix sigaltstack frame size checking
[not found] <20230822164904.21660-1-andy.chiu@sifive.com>
@ 2023-10-15 10:52 ` Aurelien Jarno
2023-10-15 17:47 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Aurelien Jarno @ 2023-10-15 10:52 UTC (permalink / raw)
To: stable; +Cc: palmer, Andy Chiu
Hi,
The patch below is an important fix, as it is necessary to run rustc on riscv.
It has been merged as commit 14a270bfab7ab1c4b605c01eeca5557447ad5a2b. I have
seen that other commits from the same pull request have already been queued for
6.5, but not this one. Would it be possible to queue it for stable 6.5?
Thanks
Aurelien
On 2023-08-22 16:49, Andy Chiu wrote:
> The alternative stack checking in get_sigframe introduced by the Vector
> support is not needed and has a problem. It is not needed as we have
> already validate it at the beginning of the function if we are already
> on an altstack. If not, the size of an altstack is always validated at
> its allocation stage with sigaltstack_size_valid().
>
> Besides, we must only regard the size of an altstack if the handler of a
> signal is registered with SA_ONSTACK. So, blindly checking overflow of
> an altstack if sas_ss_size not equals to zero will check against wrong
> signal handlers if only a subset of signals are registered with
> SA_ONSTACK.
>
> Fixes: 8ee0b41898fa ("riscv: signal: Add sigcontext save/restore for vector")
> Reported-by: Prashanth Swaminathan <prashanthsw@google.com>
> Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
> ---
> arch/riscv/kernel/signal.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c
> index 180d951d3624..21a4d0e111bc 100644
> --- a/arch/riscv/kernel/signal.c
> +++ b/arch/riscv/kernel/signal.c
> @@ -311,13 +311,6 @@ static inline void __user *get_sigframe(struct ksignal *ksig,
> /* Align the stack frame. */
> sp &= ~0xfUL;
>
> - /*
> - * Fail if the size of the altstack is not large enough for the
> - * sigframe construction.
> - */
> - if (current->sas_ss_size && sp < current->sas_ss_sp)
> - return (void __user __force *)-1UL;
> -
> return (void __user *)sp;
> }
>
> --
> 2.17.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
>
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] riscv: signal: fix sigaltstack frame size checking
2023-10-15 10:52 ` [PATCH] riscv: signal: fix sigaltstack frame size checking Aurelien Jarno
@ 2023-10-15 17:47 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2023-10-15 17:47 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: stable, palmer, Andy Chiu
On Sun, Oct 15, 2023 at 12:52:16PM +0200, Aurelien Jarno wrote:
> Hi,
>
> The patch below is an important fix, as it is necessary to run rustc on riscv.
> It has been merged as commit 14a270bfab7ab1c4b605c01eeca5557447ad5a2b. I have
> seen that other commits from the same pull request have already been queued for
> 6.5, but not this one. Would it be possible to queue it for stable 6.5?
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-15 17:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230822164904.21660-1-andy.chiu@sifive.com>
2023-10-15 10:52 ` [PATCH] riscv: signal: fix sigaltstack frame size checking Aurelien Jarno
2023-10-15 17:47 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox