Skip to content

Commit b6b8aa2

Browse files
committed
Merge branch 'for-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull userns fix from Eric Biederman: "Removing the ambiguity broke userspace so this reverts the change" * 'for-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: Revert 95ebabd ("capabilities: Don't allow writing ambiguous v3 file capabilities")
2 parents 9afc116 + 3b0c2d3 commit b6b8aa2

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

security/commoncap.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,7 @@ int cap_convert_nscap(struct user_namespace *mnt_userns, struct dentry *dentry,
543543
__u32 magic, nsmagic;
544544
struct inode *inode = d_backing_inode(dentry);
545545
struct user_namespace *task_ns = current_user_ns(),
546-
*fs_ns = inode->i_sb->s_user_ns,
547-
*ancestor;
546+
*fs_ns = inode->i_sb->s_user_ns;
548547
kuid_t rootid;
549548
size_t newsize;
550549

@@ -567,15 +566,6 @@ int cap_convert_nscap(struct user_namespace *mnt_userns, struct dentry *dentry,
567566
if (nsrootid == -1)
568567
return -EINVAL;
569568

570-
/*
571-
* Do not allow allow adding a v3 filesystem capability xattr
572-
* if the rootid field is ambiguous.
573-
*/
574-
for (ancestor = task_ns->parent; ancestor; ancestor = ancestor->parent) {
575-
if (from_kuid(ancestor, rootid) == 0)
576-
return -EINVAL;
577-
}
578-
579569
newsize = sizeof(struct vfs_ns_cap_data);
580570
nscap = kmalloc(newsize, GFP_ATOMIC);
581571
if (!nscap)

0 commit comments

Comments
 (0)