public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <pmoore@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-security-module@vger.kernel.org
Subject: Re: [PATCH] cipso: handle CIPSO options correctly when NetLabel is disabled
Date: Fri, 01 Jun 2012 09:14:19 -0400	[thread overview]
Message-ID: <1458832.5C3jQy5BFx@sifl> (raw)
In-Reply-To: <20120531.190705.3612500429295140.davem@davemloft.net>

On Thursday, May 31, 2012 07:07:05 PM David Miller wrote:
> From: Paul Moore <pmoore@redhat.com>
> Date: Thu, 31 May 2012 16:09:23 -0400
> 
> > When NetLabel is not enabled, e.g. CONFIG_NETLABEL=n, and the system
> > receives a CIPSO tagged packet it is dropped (cipso_v4_validate()
> > returns non-zero).  In most cases this is the correct and desired
> > behavior, however, in the case where we are simply forwarding the
> > traffic, e.g. acting as a network bridge, this becomes a problem.
> > 
> > This patch fixes the forwarding problem by providing the basic CIPSO
> > validation code directly in ip_options_compile() without the need for
> > the NetLabel or CIPSO code.  The new validation code can not perform
> > any of the CIPSO option label/value verification that
> > cipso_v4_validate() does, but it can verify the basic CIPSO option
> > format.
> > 
> > The behavior when NetLabel is enabled is unchanged.
> > 
> > Signed-off-by: Paul Moore <pmoore@redhat.com>
> 
> I don't like this at all.
> 
> The only conclusion I can come to is that cipso_v4_validate() is doing
> the wrong thing when NETLABEL is disabled.
> 
> There is never a good reason to crap all over a function with ifdefs.
> This is especially true when it's being done to paper over a function
> with poor semantics.
> 
> The whole idea is to abstract and put all of this kind of logic into
> cipso_v4_validate().

I originally had the #ifdef'd code in the non-CONFIG_NETLABEL 
cipso_v4_validate() in include/net/cipso_ipv4.h but thought it was too much 
code to put there.  No worries, I'll just move it back and resubmit.

-- 
paul moore
security and virtualization @ redhat

      reply	other threads:[~2012-06-01 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 20:09 [PATCH] cipso: handle CIPSO options correctly when NetLabel is disabled Paul Moore
2012-05-31 23:07 ` David Miller
2012-06-01 13:14   ` Paul Moore [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=1458832.5C3jQy5BFx@sifl \
    --to=pmoore@redhat.com \
    --cc=davem@davemloft.net \
    --cc=linux-security-module@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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