public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] cve-2015-3290: Fail on unexpected signal
@ 2024-06-13 15:29 Martin Doucha
  2024-06-13 15:29 ` [LTP] [PATCH 2/2] cve-2015-3290: Check for mishandled modify_ldt() return value Martin Doucha
  2024-06-21 11:33 ` [LTP] [PATCH 1/2] cve-2015-3290: Fail on unexpected signal Petr Vorel
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Doucha @ 2024-06-13 15:29 UTC (permalink / raw)
  To: ltp

The test expects the child process to either be killed by SIGSEGV,
or cleanly exit. If the child gets killed by unexpected signal,
the parent process will fail to report any result. Fix the rare
corner case.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/cve/cve-2015-3290.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/testcases/cve/cve-2015-3290.c b/testcases/cve/cve-2015-3290.c
index a2a8fcedd..0aad26d74 100644
--- a/testcases/cve/cve-2015-3290.c
+++ b/testcases/cve/cve-2015-3290.c
@@ -454,10 +454,14 @@ static void run(void)
 	}
 
 	SAFE_WAITPID(pid, &status, 0);
-	if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)
+	if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV) {
 		tst_res(TFAIL, "corrupted NMI stack");
-	else if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
+	} else if (WIFSIGNALED(status)) {
+		tst_res(TFAIL, "Child killed by unexpected signal %s",
+			tst_strsig(WTERMSIG(status)));
+	} else if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
 		tst_res(WEXITSTATUS(status), "Propogate child status");
+	}
 }
 
 static struct tst_test test = {
-- 
2.44.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2024-06-21 11:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-13 15:29 [LTP] [PATCH 1/2] cve-2015-3290: Fail on unexpected signal Martin Doucha
2024-06-13 15:29 ` [LTP] [PATCH 2/2] cve-2015-3290: Check for mishandled modify_ldt() return value Martin Doucha
2024-06-21 11:33 ` [LTP] [PATCH 1/2] cve-2015-3290: Fail on unexpected signal Petr Vorel

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