cipso: handle CIPSO options correctly when NetLabel is disabled
authorPaul Moore <pmoore@redhat.com>
Fri, 1 Jun 2012 05:54:56 +0000 (05:54 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Jul 2012 03:32:12 +0000 (04:32 +0100)
commitdff31bdf228689241933ea5bf62ba98de3eec42e
tree682c49aabfca89a59d59333ebfcd0f2e45512443
parentcaade06b9bc468620636953b15d7d36a12d2b88e
cipso: handle CIPSO options correctly when NetLabel is disabled

[ Upstream commit 20e2a86485967c385d7c7befc1646e4d1d39362e ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
include/net/cipso_ipv4.h