[LTP] [PATCH v3 1/9] Rewrite userns01.c using new LTP API

Cyril Hrubis chrubis@suse.cz
Fri Mar 25 16:43:59 CET 2022


Hi!
Pushed with one small change.

diff --git a/testcases/kernel/containers/userns/userns01.c b/testcases/kernel/containers/userns/userns01.c
index 460c20a8d..67708f10e 100644
--- a/testcases/kernel/containers/userns/userns01.c
+++ b/testcases/kernel/containers/userns/userns01.c
@@ -93,6 +93,10 @@ static struct tst_test test = {
        .setup = setup,
        .test_all = run,
        .needs_root = 1,
+       .caps = (struct tst_cap []) {
+               TST_CAP(TST_CAP_DROP, CAP_NET_RAW),
+               {}
+       },
        .needs_kconfigs = (const char *[]) {
                "CONFIG_USER_NS",
                NULL,

This ensures that at least one capability is not set in the effective
and permitted set before we call clone(). Otherwise we will have the
full capability set before the clone() and we would inherit a full set
of the capabilities regardless of the CLONE_NEWUSR.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list