Skip to contentSkip to conversation

Move prctl04 in seccomp testing suite

PATCH Superseded Andrea Cervesato 3 participants 4 messages Jun 7, 2024 – Jun 10, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Move prctl04 in seccomp testing suite

From: Andrea Cervesato <[email protected]>

prictl04 has been renamed as seccomp01 and a test variant has been added in order to support the seccomp() syscall, that is currently equivalent to prctl(PR_SET_SECCOMP).

---
This testing suite is aiming to test seccomp() syscall which is supposed to wrap prctl(PR_SET_SECCOMP). Some parts have been moved from prctl tesitng suite to a new seccomp testing suite and added a test variant.

---
 runtest/syscalls                                   |  3 +-
 testcases/kernel/syscalls/prctl/.gitignore         |  1 -
 testcases/kernel/syscalls/seccomp/.gitignore       |  1 +
 testcases/kernel/syscalls/seccomp/Makefile         |  7 ++
 .../{prctl/prctl04.c => seccomp/seccomp01.c}       | 79 +++++++++++++---------
 5 files changed, 56 insertions(+), 35 deletions(-)
runtest/syscalls +2 -1
index cf06ee563..a6614141a 100644
@@ -1021,7 +1021,6 @@ ppoll01 ppoll01
 prctl01 prctl01
 prctl02 prctl02
 prctl03 prctl03
-prctl04 prctl04
 prctl05 prctl05
 prctl06 prctl06
 prctl07 prctl07
@@ -1239,6 +1238,8 @@ sched_setattr01 sched_setattr01
 sched_getattr01 sched_getattr01
 sched_getattr02 sched_getattr02
 
+seccomp01 seccomp01
+
 select01 select01
 select02 select02
 select03 select03
testcases/kernel/syscalls/prctl/.gitignore +0 -1
index 50ee4bf60..8bcc22f98 100644
@@ -1,7 +1,6 @@
 /prctl01
 /prctl02
 /prctl03
-/prctl04
 /prctl05
 /prctl06
 /prctl06_execve
testcases/kernel/syscalls/seccomp/.gitignore new file +1 -0
new file mode 100644
index 000000000..9196906cf
@@ -0,0 +1 @@
+seccomp01
testcases/kernel/syscalls/seccomp/Makefile new file +7 -0
new file mode 100644
index 000000000..8cf1b9024
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2024 SUSE LLC Andrea Cervesato <[email protected]>
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/seccomp/seccomp01.c renamed from testcases/kernel/syscalls/prctl/prctl04.c +46 -33

146 lines not on this page · raw message

---
base-commit: 66517b89141fc455ed807f3b95e5260dcf9fb90f
change-id: 20240603-seccomp-06f18e9551df

Best regards,

Signature · 5 lines
Andrea Cervesato <[email protected]>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi Andrea,

Quoted 5 lines

From: Andrea Cervesato <[email protected]>

prictl04 has been renamed as seccomp01 and a test variant has been added in order to support the seccomp() syscall, that is currently equivalent to prctl(PR_SET_SECCOMP).

It'd be nice to update test description, that __NR_seccomp is also used.

And print info what is being tested, based on tst_variant (see chmod/chmod01.c).

BTW the old test was broken on musl:
prctl04.c:212: TFAIL: SECCOMP_MODE_FILTER doesn't permit exit()

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi Petr,

Quoted 9 lines · Petr Vorel

Hi Andrea,

Quoted 4 lines

From: Andrea Cervesato <[email protected]>
prictl04 has been renamed as seccomp01 and a test variant has been added in order to support the seccomp() syscall, that is currently equivalent to prctl(PR_SET_SECCOMP).

It'd be nice to update test description, that __NR_seccomp is also used.

That can be done easily

Quoted 2 lines

And print info what is being tested, based on tst_variant (see chmod/chmod01.c).

Ok

Quoted 2 lines

BTW the old test was broken on musl:
prctl04.c:212: TFAIL: SECCOMP_MODE_FILTER doesn't permit exit()

I don't know about this. Maybe it requires one more test. Is there are reason for that?

Quoted 3 lines

Kind regards,
Petr

Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Hi Andrea,

Quoted 5 lines

Hi Petr,

Quoted 1 line · Petr Vorel

Hi Andrea,

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

From: Andrea Cervesato <[email protected]>
prictl04 has been renamed as seccomp01 and a test variant has been added in order to support the seccomp() syscall, that is currently equivalent to prctl(PR_SET_SECCOMP).

It'd be nice to update test description, that __NR_seccomp is also used.

That can be done easily

Sure (this would not block merging if it were the only thing).

Quoted 2 lines
Quoted 1 line

And print info what is being tested, based on tst_variant (see chmod/chmod01.c).

Ok

I could even add this, if you don't have time to send new version (please Cc me with the new version or let me know if I should just modify the test).

Quoted 5 lines
Quoted 2 lines

BTW the old test was broken on musl:
prctl04.c:212: TFAIL: SECCOMP_MODE_FILTER doesn't permit exit()

I don't know about this. Maybe it requires one more test. Is there are reason for that?

That's kind of report that either musl has bug or it's a test bug when running on musl. We at SUSE does not care about musl, thus it's for somebody who actually cares.

Kind regards,
Petr

Quoted 4 lines
Quoted 2 lines

Kind regards,
Petr

Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp