Thread (51 messages) 51 messages, 8 authors, 2020-03-02

Re: [PATCH v3 19/25] commoncap: handle fsid mappings with vfs caps

From: Jann Horn <jannh@google.com>
Date: 2020-02-19 15:54:15
Also in: linux-api, linux-fsdevel, lkml

On Tue, Feb 18, 2020 at 3:35 PM Christian Brauner
[off-list ref] wrote:
Switch vfs cap helpers to lookup fsids in the fsid mappings. If no fsid
mappings are setup the behavior is unchanged, i.e. fsids are looked up in the
id mappings.
[...]
quoted hunk ↗ jump to hunk
diff --git a/security/commoncap.c b/security/commoncap.c
[...]
quoted hunk ↗ jump to hunk
@@ -328,7 +328,7 @@ static bool rootid_owns_currentns(kuid_t kroot)
                return false;

        for (ns = current_user_ns(); ; ns = ns->parent) {
-               if (from_kuid(ns, kroot) == 0)
+               if (from_kfsuid(ns, kroot) == 0)
                        return true;
                if (ns == &init_user_ns)
                        break;
Nit: Maybe change the name of this function to something that makes it
clear that this operates in the fsuid mapping domain.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help