All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul.moore@hp.com>
To: Venkat Yekkirala <vyekkirala@TrustedCS.com>
Cc: selinux@tycho.nsa.gov, sds@tycho.nsa.gov
Subject: Re: [PATCH 1/1] selinux: Delete mls_copy_context
Date: Tue, 12 Dec 2006 11:13:55 -0500	[thread overview]
Message-ID: <457ED543.80905@hp.com> (raw)
In-Reply-To: <457EC911.7060006@trustedcs.com>

Venkat Yekkirala wrote:
> diff --git a/security/selinux/ss/context.h b/security/selinux/ss/context.h
> index 0562bac..3f57585 100644
> --- a/security/selinux/ss/context.h
> +++ b/security/selinux/ss/context.h
> @@ -55,6 +55,29 @@ out:
>  	return rc;
>  }
>  
> +/*
> + * Copies the effective MLS range from `src' into `dst'.
> + */

This isn't your fault, the old code used the same comment, but I wonder if it is
better to say:

 "Copies the low MLS range from 'src' into 'dst'."

As the concept of "effective" and "clearance" are policy constructs and not
hardcoded into the kernel.

> +static inline int mls_context_scpy(struct context *dst, struct context *src)
> +{
> +	int rc;
> +
> +	if (!selinux_mls_enabled)
> +		return 0;
> +
> +	dst->range.level[0].sens = src->range.level[0].sens;
> +	rc = ebitmap_cpy(&dst->range.level[0].cat, &src->range.level[0].cat);
> +	if (rc)
> +		goto out;
> +
> +	dst->range.level[1].sens = src->range.level[0].sens;
> +	rc = ebitmap_cpy(&dst->range.level[1].cat, &src->range.level[0].cat);
> +	if (rc)
> +		ebitmap_destroy(&dst->range.level[0].cat);
> +out:
> +	return rc;
> +}

-- 
paul moore
linux security @ hp

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2006-12-12 16:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12 15:21 [PATCH 1/1] selinux: Delete mls_copy_context Venkat Yekkirala
2006-12-12 16:13 ` Paul Moore [this message]
2006-12-12 18:31   ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=457ED543.80905@hp.com \
    --to=paul.moore@hp.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=vyekkirala@TrustedCS.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.