--- v14
+++ v13
@@ -11,12 +11,8 @@
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Reviewed-by: Thibaut Sautereau <thibaut.sautereau@ssi.gouv.fr>
-Link: https://lore.kernel.org/r/20211008104840.1733385-4-mic@digikod.net
+Link: https://lore.kernel.org/r/20211007182321.872075-4-mic@digikod.net
---
-
-Changes since v13:
-* Move -I to CFLAGS (suggested by Kees Cook).
-* Update sysctl name.
Changes since v12:
* Fix Makefile's license.
@@ -110,13 +106,13 @@
+/*_test
diff --git a/tools/testing/selftests/interpreter/Makefile b/tools/testing/selftests/interpreter/Makefile
new file mode 100644
-index 000000000000..7402fdb6533f
+index 000000000000..1f71a161d40b
--- /dev/null
+++ b/tools/testing/selftests/interpreter/Makefile
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0
+
-+CFLAGS += -Wall -O2 -I$(khdr_dir)
++CFLAGS += -Wall -O2
+LDLIBS += -lcap
+
+src_test := $(wildcard *_test.c)
@@ -134,7 +130,7 @@
+ @:
+
+$(OUTPUT)/%_test: %_test.c $(khdr_dir)/asm-generic/unistd.h $(khdr_dir)/linux/trusted-for.h ../kselftest_harness.h
-+ $(LINK.c) $< $(LDLIBS) -o $@
++ $(LINK.c) $< $(LDLIBS) -o $@ -I$(khdr_dir)
diff --git a/tools/testing/selftests/interpreter/config b/tools/testing/selftests/interpreter/config
new file mode 100644
index 000000000000..dd53c266bf52
@@ -144,13 +140,13 @@
+CONFIG_SYSCTL=y
diff --git a/tools/testing/selftests/interpreter/trust_policy_test.c b/tools/testing/selftests/interpreter/trust_policy_test.c
new file mode 100644
-index 000000000000..b59f07f537ad
+index 000000000000..4818c5524ec0
--- /dev/null
+++ b/tools/testing/selftests/interpreter/trust_policy_test.c
@@ -0,0 +1,362 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
-+ * Test trusted_for(2) with fs.trusted_for_policy sysctl
++ * Test trusted_for(2) with fs.trust_policy sysctl
+ *
+ * Copyright © 2018-2020 ANSSI
+ *
@@ -185,7 +181,7 @@
+}
+#endif
+
-+static const char sysctl_path[] = "/proc/sys/fs/trusted_for_policy";
++static const char sysctl_path[] = "/proc/sys/fs/trust_policy";
+
+static const char workdir_path[] = "./test-mount";
+static const char reg_file_path[] = "./test-mount/regular_file";