linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/tests: exec: drop duplicate bprm_stack_limits test vectors
@ 2026-02-03 17:59 Titouan Ameline de Cadeville
  2026-02-04  1:36 ` Kees Cook
  2026-02-04  1:41 ` Kees Cook
  0 siblings, 2 replies; 3+ messages in thread
From: Titouan Ameline de Cadeville @ 2026-02-03 17:59 UTC (permalink / raw)
  To: kees; +Cc: linux-mm, linux-kernel, Titouan Ameline de Cadeville

Remove duplicate entries from the bprm_stack_limits KUnit test vector
table. The duplicates do not add coverage and only increase test size.

Signed-off-by: Titouan Ameline de Cadeville <titouan.ameline@gmail.com>
---
 fs/tests/exec_kunit.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/tests/exec_kunit.c b/fs/tests/exec_kunit.c
index 7c77d039680b..f412d1a0f6bb 100644
--- a/fs/tests/exec_kunit.c
+++ b/fs/tests/exec_kunit.c
@@ -87,9 +87,6 @@ static const struct bprm_stack_limits_result bprm_stack_limits_results[] = {
 	    .argc = 0, .envc = ARG_MAX / sizeof(void *) - 1 },
 	  .expected_argmin = ULONG_MAX - sizeof(void *) },
 	/* Raising rlim_stack / 4 to _STK_LIM / 4 * 3 will see more space. */
-	{ { .p = ULONG_MAX, .rlim_stack.rlim_cur = 4 * (_STK_LIM / 4 * 3),
-	    .argc = 0, .envc = 0 },
-	  .expected_argmin = ULONG_MAX - (_STK_LIM / 4 * 3) + sizeof(void *) },
 	{ { .p = ULONG_MAX, .rlim_stack.rlim_cur = 4 * (_STK_LIM / 4 * 3),
 	    .argc = 0, .envc = 0 },
 	  .expected_argmin = ULONG_MAX - (_STK_LIM / 4 * 3) + sizeof(void *) },
@@ -103,9 +100,6 @@ static const struct bprm_stack_limits_result bprm_stack_limits_results[] = {
 	{ { .p = ULONG_MAX, .rlim_stack.rlim_cur = 4 * _STK_LIM,
 	    .argc = 0, .envc = 0 },
 	  .expected_argmin = ULONG_MAX - (_STK_LIM / 4 * 3) + sizeof(void *) },
-	{ { .p = ULONG_MAX, .rlim_stack.rlim_cur = 4 * _STK_LIM,
-	    .argc = 0, .envc = 0 },
-	  .expected_argmin = ULONG_MAX - (_STK_LIM / 4 * 3) + sizeof(void *) },
 };
 
 static void exec_test_bprm_stack_limits(struct kunit *test)
-- 
2.44.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs/tests: exec: drop duplicate bprm_stack_limits test vectors
  2026-02-03 17:59 [PATCH] fs/tests: exec: drop duplicate bprm_stack_limits test vectors Titouan Ameline de Cadeville
@ 2026-02-04  1:36 ` Kees Cook
  2026-02-04  1:41 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2026-02-04  1:36 UTC (permalink / raw)
  To: Titouan Ameline de Cadeville; +Cc: linux-mm, linux-kernel

On Tue, Feb 03, 2026 at 06:59:50PM +0100, Titouan Ameline de Cadeville wrote:
> Remove duplicate entries from the bprm_stack_limits KUnit test vector
> table. The duplicates do not add coverage and only increase test size.

Hm, yes, these are pointless duplicates. It makes me think I typo'd
something here.

> Signed-off-by: Titouan Ameline de Cadeville <titouan.ameline@gmail.com>

Regardless:

Fixes: 60371f43e56b ("exec: Add KUnit test for bprm_stack_limits()")

> ---
>  fs/tests/exec_kunit.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/fs/tests/exec_kunit.c b/fs/tests/exec_kunit.c
> index 7c77d039680b..f412d1a0f6bb 100644
> --- a/fs/tests/exec_kunit.c
> +++ b/fs/tests/exec_kunit.c
> @@ -87,9 +87,6 @@ static const struct bprm_stack_limits_result bprm_stack_limits_results[] = {
>  	    .argc = 0, .envc = ARG_MAX / sizeof(void *) - 1 },
>  	  .expected_argmin = ULONG_MAX - sizeof(void *) },
>  	/* Raising rlim_stack / 4 to _STK_LIM / 4 * 3 will see more space. */
> -	{ { .p = ULONG_MAX, .rlim_stack.rlim_cur = 4 * (_STK_LIM / 4 * 3),
> -	    .argc = 0, .envc = 0 },
> -	  .expected_argmin = ULONG_MAX - (_STK_LIM / 4 * 3) + sizeof(void *) },
>  	{ { .p = ULONG_MAX, .rlim_stack.rlim_cur = 4 * (_STK_LIM / 4 * 3),
>  	    .argc = 0, .envc = 0 },
>  	  .expected_argmin = ULONG_MAX - (_STK_LIM / 4 * 3) + sizeof(void *) },

Looking at the surrounding tests and trying to jog my memory, I think I
meant to have differing envc values here, but that turned out not to be
useful: I wanted to test the impact of rlim_stack.rlim_cur, not
argc/envc here.

> @@ -103,9 +100,6 @@ static const struct bprm_stack_limits_result bprm_stack_limits_results[] = {
>  	{ { .p = ULONG_MAX, .rlim_stack.rlim_cur = 4 * _STK_LIM,
>  	    .argc = 0, .envc = 0 },
>  	  .expected_argmin = ULONG_MAX - (_STK_LIM / 4 * 3) + sizeof(void *) },
> -	{ { .p = ULONG_MAX, .rlim_stack.rlim_cur = 4 * _STK_LIM,
> -	    .argc = 0, .envc = 0 },
> -	  .expected_argmin = ULONG_MAX - (_STK_LIM / 4 * 3) + sizeof(void *) },

Same here.

Reviewed-by: Kees Cook <kees@kernel.org>

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs/tests: exec: drop duplicate bprm_stack_limits test vectors
  2026-02-03 17:59 [PATCH] fs/tests: exec: drop duplicate bprm_stack_limits test vectors Titouan Ameline de Cadeville
  2026-02-04  1:36 ` Kees Cook
@ 2026-02-04  1:41 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2026-02-04  1:41 UTC (permalink / raw)
  To: Titouan Ameline de Cadeville; +Cc: Kees Cook, linux-mm, linux-kernel

On Tue, 03 Feb 2026 18:59:50 +0100, Titouan Ameline de Cadeville wrote:
> Remove duplicate entries from the bprm_stack_limits KUnit test vector
> table. The duplicates do not add coverage and only increase test size.
> 
> 

Applied to for-next/execve, thanks!

[1/1] fs/tests: exec: drop duplicate bprm_stack_limits test vectors
      https://git.kernel.org/kees/c/46a03ea50b5f

Take care,

-- 
Kees Cook



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-04  1:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-03 17:59 [PATCH] fs/tests: exec: drop duplicate bprm_stack_limits test vectors Titouan Ameline de Cadeville
2026-02-04  1:36 ` Kees Cook
2026-02-04  1:41 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox