diff mbox series

[v2,1/4] arm64/signal: Raise limit on stack frames

Message ID 20220815132834.229769-2-broonie@kernel.org (mailing list archive)
State New, archived
Headers show
Series arm64/sme: SME related fixes | expand

Commit Message

Mark Brown Aug. 15, 2022, 1:28 p.m. UTC
The signal code has a limit of 64K on the size of a stack frame that it
will generate, if this limit is exceeded then a process will be killed if
it receives a signal. Unfortunately with the advent of SME this limit is
too small - the maximum possible size of the ZA register alone is 64K. This
is not an issue for practical systems at present but is easily seen using
virtual platforms.

Raise the limit to 256K, this is substantially more than could be used by
any current architecture extension.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 arch/arm64/kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Catalin Marinas Aug. 17, 2022, 2:04 p.m. UTC | #1
On Mon, Aug 15, 2022 at 02:28:31PM +0100, Mark Brown wrote:
> The signal code has a limit of 64K on the size of a stack frame that it
> will generate, if this limit is exceeded then a process will be killed if
> it receives a signal. Unfortunately with the advent of SME this limit is
> too small - the maximum possible size of the ZA register alone is 64K. This
> is not an issue for practical systems at present but is easily seen using
> virtual platforms.
> 
> Raise the limit to 256K, this is substantially more than could be used by
> any current architecture extension.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  arch/arm64/kernel/signal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
> index 3e6d0352d7d3..a410c980e50e 100644
> --- a/arch/arm64/kernel/signal.c
> +++ b/arch/arm64/kernel/signal.c
> @@ -91,7 +91,7 @@ static size_t sigframe_size(struct rt_sigframe_user_layout const *user)
>   * not taken into account.  This limit is not a guarantee and is
>   * NOT ABI.
>   */
> -#define SIGFRAME_MAXSZ SZ_64K
> +#define SIGFRAME_MAXSZ (SZ_64K * 4)

Why not SZ_256K?

Otherwise it looks fine:

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Mark Brown Aug. 17, 2022, 3:24 p.m. UTC | #2
On Wed, Aug 17, 2022 at 03:04:40PM +0100, Catalin Marinas wrote:
> On Mon, Aug 15, 2022 at 02:28:31PM +0100, Mark Brown wrote:

> > -#define SIGFRAME_MAXSZ SZ_64K
> > +#define SIGFRAME_MAXSZ (SZ_64K * 4)

> Why not SZ_256K?

I think I'd initially picked a different number which didn't have a SZ_
macro then forgot to check if there was one when I dithered back to
256K.
diff mbox series

Patch

diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index 3e6d0352d7d3..a410c980e50e 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -91,7 +91,7 @@  static size_t sigframe_size(struct rt_sigframe_user_layout const *user)
  * not taken into account.  This limit is not a guarantee and is
  * NOT ABI.
  */
-#define SIGFRAME_MAXSZ SZ_64K
+#define SIGFRAME_MAXSZ (SZ_64K * 4)
 
 static int __sigframe_alloc(struct rt_sigframe_user_layout *user,
 			    unsigned long *offset, size_t size, bool extend)