fs/tests: exec: drop duplicate bprm_stack_limits test vectors
Subsystems (2)
PATCH 1/1 fs/tests: exec: drop duplicate bprm_stack_limits test vectors
Remove duplicate entries from the bprm_stack_limits KUnit test vector table. The duplicates do not add coverage and only increase test size.
--- fs/tests/exec_kunit.c | 6 ------ 1 file changed, 6 deletions(-)
fs/tests/exec_kunit.c +0 -6
@@ -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)
Signature · 1 line
2.44.2
Quoted 2 lines · Titouan Ameline de Cadeville
Remove duplicate entries from the
bprm_stack_limitsKUnit 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.
Quoted 1 line
Signed-off-by Titouan Ameline de Cadeville <[email protected]>
Regardless:
Quoted 9 lines
--- fs/tests/exec_kunit.c | 6 ------ 1 file changed, 6 deletions(-)fs/tests/exec_kunit.c +0
-0
fs/tests/exec_kunit.c static const struct bprm_stack_limits_result bprm_stack_limits_results[] = { · line 92
Quoted 9 lines
fs/tests/exec_kunit.c +0
-3@@ -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.
fs/tests/exec_kunit.c static const struct bprm_stack_limits_result bprm_stack_limits_results[] = { · line 108
Quoted 7 lines
fs/tests/exec_kunit.c +0
-3@@ -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.
Signature · 1 line
Kees Cook
Quoted 4 lines · Titouan Ameline de Cadeville
Remove duplicate entries from the
bprm_stack_limitsKUnit 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,
Signature · 1 line
Kees Cook