netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Paris <eparis@parisplace.org>
To: Venkat Yekkirala <vyekkirala@TrustedCS.com>
Cc: netdev@vger.kernel.org, selinux@tycho.nsa.gov, jmorris@namei.org,
	sds@tycho.nsa.gov
Subject: Re: [PATCH 1/3] mlsxfrm: Various fixes
Date: Tue, 07 Nov 2006 14:09:43 -0500	[thread overview]
Message-ID: <1162926583.3268.22.camel@localhost.localdomain> (raw)
In-Reply-To: <4550BF91.6040906@trustedcs.com>

On Tue, 2006-11-07 at 11:17 -0600, Venkat Yekkirala wrote:
>  int selinux_xfrm_policy_alloc(struct xfrm_policy *xp,
> -		struct xfrm_user_sec_ctx *uctx, struct sock *sk)
> +		struct xfrm_user_sec_ctx *uctx)
>  {
>  	int err;
> -	u32 sid;
>  
> -	BUG_ON(!xp);
> -	BUG_ON(uctx && sk);
> -
> -	if (sk) {
> -		struct sk_security_struct *ssec = sk->sk_security;
> -		sid = ssec->sid;
> -	}
> -	else
> -		sid = SECSID_NULL;
> +	BUG_ON(!xp || !uctx);
>  
> -	err = selinux_xfrm_sec_ctx_alloc(&xp->security, uctx, NULL, sid);
> +	err = selinux_xfrm_sec_ctx_alloc(&xp->security, uctx, 0);
>  	return err;
>  }

BUG_ON() with an || makes this a slight bit trickier to debug if
something goes wrong.  I'd have to dig around a little in the assembly
and look at the registers in the back trace to know which of the 2 was
the problem.  I personally would rather have a seperate

BUG_ON(!xp);
BUG_ON(!uctx);

probably not worth resubmitting, but if you have to make another set of
these....

-Eric


      reply	other threads:[~2006-11-07 19:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-07 17:17 [PATCH 1/3] mlsxfrm: Various fixes Venkat Yekkirala
2006-11-07 19:09 ` Eric Paris [this message]

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=1162926583.3268.22.camel@localhost.localdomain \
    --to=eparis@parisplace.org \
    --cc=jmorris@namei.org \
    --cc=netdev@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).