public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] cve-2015-3290: Fix tst_syscall() return value
@ 2023-02-15 14:42 Martin Doucha
  2023-02-15 15:20 ` Petr Vorel
  2023-02-16  9:24 ` Richard Palethorpe
  0 siblings, 2 replies; 7+ messages in thread
From: Martin Doucha @ 2023-02-15 14:42 UTC (permalink / raw)
  To: ltp

The modify_ldt() syscall returns 32-bit signed integer value. Recent changes
in tst_syscall() caused the value to be interpreted as unsigned on older
kernels/glibc, which breaks the cve-2015-3290 test. Add explicit type cast
to fix it.

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

diff --git a/testcases/cve/cve-2015-3290.c b/testcases/cve/cve-2015-3290.c
index f61d2809b..a2a8fcedd 100644
--- a/testcases/cve/cve-2015-3290.c
+++ b/testcases/cve/cve-2015-3290.c
@@ -195,7 +195,8 @@ static void set_ldt(void)
 		.useable	 = 0
 	};
 
-	TEST(tst_syscall(__NR_modify_ldt, 1, &data_desc, sizeof(data_desc)));
+	TEST((int)tst_syscall(__NR_modify_ldt, 1, &data_desc,
+		sizeof(data_desc)));
 	if (TST_RET == -EINVAL) {
 		tst_brk(TCONF | TRERRNO,
 			"modify_ldt: 16-bit data segments are probably disabled");
-- 
2.39.0


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

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

end of thread, other threads:[~2023-02-16 10:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15 14:42 [LTP] [PATCH] cve-2015-3290: Fix tst_syscall() return value Martin Doucha
2023-02-15 15:20 ` Petr Vorel
2023-02-15 15:34   ` Teo Couprie Diaz
2023-02-15 15:51     ` Martin Doucha
2023-02-15 15:57     ` Petr Vorel
2023-02-16 10:12     ` Richard Palethorpe
2023-02-16  9:24 ` Richard Palethorpe

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