[LTP] [PATCH] [v2] execve05: add exit call when execve failed

yeziwen1989@yeah.net yeziwen1989@yeah.net
Fri Jun 5 07:44:53 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.

Signed-off-by: Yeguojin <yeziwen1989@yeah.net>
---
 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..e68aa18c4 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_SUCCESS);
 }
 
 static void verify_execve(void)
-- 
2.34.1



More information about the ltp mailing list