[CRIU] [PATCH 3/3] cr-check: add logiuid feature

Dmitry Safonov dsafonov at odin.com
Wed Dec 23 05:47:38 PST 2015


Loginuid tests should run only when kdat.has_loginuid set.
This is for > 3.13 kernels with CONFIG_AUDITSYSCALL enabled.

Signed-off-by: Dmitry Safonov <dsafonov at odin.com>
---
 cr-check.c                          | 15 +++++++++++++++
 test/zdtm/live/static/loginuid.desc |  1 +
 2 files changed, 16 insertions(+)
 create mode 100644 test/zdtm/live/static/loginuid.desc

diff --git a/cr-check.c b/cr-check.c
index a3dc662..b955cc0 100644
--- a/cr-check.c
+++ b/cr-check.c
@@ -926,6 +926,19 @@ static int check_userns(void)
 	return 0;
 }
 
+static int check_loginuid(void)
+{
+	if (kerndat_loginuid(false) < 0)
+		return -1;
+
+	if (!kdat.has_loginuid) {
+		pr_warn("Loginuid restore is OFF.\n");
+		return -1;
+	}
+
+	return 0;
+}
+
 int check_add_feature(char *feat)
 {
 	if (!strcmp(feat, "mnt_id"))
@@ -944,6 +957,8 @@ int check_add_feature(char *feat)
 		chk_feature = check_ptrace_suspend_seccomp;
 	else if (!strcmp(feat, "seccomp_filters"))
 		chk_feature = check_ptrace_dump_seccomp_filters;
+	else if (!strcmp(feat, "loginuid"))
+		chk_feature = check_loginuid;
 	else {
 		pr_err("Unknown feature %s\n", feat);
 		return -1;
diff --git a/test/zdtm/live/static/loginuid.desc b/test/zdtm/live/static/loginuid.desc
new file mode 100644
index 0000000..e27f6cc
--- /dev/null
+++ b/test/zdtm/live/static/loginuid.desc
@@ -0,0 +1 @@
+{'feature': 'loginuid'}
-- 
2.6.4



More information about the CRIU mailing list