Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1313174 > unrolled thread

Re: [PATCH RFC] Introduce new security.nscapability xattr

Started byJann Horn <jann@thejh.net>
First post2016-01-20 13:20 +0100
Last post2016-01-20 13:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH RFC] Introduce new security.nscapability xattr Jann Horn <jann@thejh.net> - 2016-01-20 13:20 +0100

#1313174 — Re: [PATCH RFC] Introduce new security.nscapability xattr

FromJann Horn <jann@thejh.net>
Date2016-01-20 13:20 +0100
SubjectRe: [PATCH RFC] Introduce new security.nscapability xattr
Message-ID<qSZTY-6cg-9@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

On Mon, Nov 30, 2015 at 04:43:56PM -0600, Serge E. Hallyn wrote:
> +int get_vfs_ns_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps)
> +{
[...]
> +	/* find an applicable entry */
> +	/* a global entry (uid == -1) takes precedence */
> +	current_root = make_kuid(current_user_ns(), 0);
> +	if (!uid_valid(current_root)) {
> +		/* no root user in this namespace;  no capabilities */
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
> +	for (i = 0, cap = (void *) hdr + sizeof(*hdr); i < ncaps; cap += sizeof(*cap), i++) {
> +		uid_t uid = le32_to_cpu(cap->rootid);
> +		if (uid == -1) {
> +			nscap = cap;
> +			break;
> +		}
> +
> +		caprootuid = make_kuid(&init_user_ns, uid);
> +		if (uid_eq(caprootuid, current_root))
> +			nscap = cap;
> +	}

Wouldn't it be more consistent to check against the root uids of all parent
namespaces until one matches?

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web