[LTP] [PATCH] execve05: add exit call when execve failed
yeziwen1989@yeah.net
yeziwen1989@yeah.net
Thu Jun 4 18:01:12 CEST 2026
From: Yeguojin <yeziwen1989@yeah.net>
When execve_child loses its executable permission
due to other exceptions, execve05 will degenerate
into a fork bomb, which will then exhaust system
resources and cause other system exceptions.
---
testcases/kernel/syscalls/execve/execve05.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/testcases/kernel/syscalls/execve/execve05.c b/testcases/kernel/syscalls/execve/execve05.c
index 352c73c38..4b7eca9cf 100644
--- a/testcases/kernel/syscalls/execve/execve05.c
+++ b/testcases/kernel/syscalls/execve/execve05.c
@@ -39,6 +39,7 @@ static void do_child(void)
TEST(execve(TEST_APP, argv, environ));
tst_res(TFAIL | TTERRNO, "execve() returned unexpected errno");
+ exit(EXIT_FAILURE);
}
static void verify_execve(void)
--
2.34.1
More information about the ltp
mailing list