netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: paul.moore@hp.com
To: netdev@vger.kernel.org, selinux@tycho.nsa.gov
Cc: jmorris@namei.org, eparis@redhat.com, Paul Moore <paul.moore@hp.com>
Subject: [PATCH 3/3] NetLabel: the CIPSOv4 passthrough mapping does not pass categories correctly
Date: Wed, 11 Oct 2006 19:10:49 -0400	[thread overview]
Message-ID: <20061011231357.321273000@hp.com> (raw)
In-Reply-To: 20061011231046.825517000@hp.com

[-- Attachment #1: netlabel-cipso_passfix --]
[-- Type: text/plain, Size: 1011 bytes --]

From: Paul Moore <paul.moore@hp.com>

The CIPSO passthrough mapping had a problem when sending categories which
would cause no or incorrect categories to be sent on the wire with a packet.
This patch fixes the problem which was a simple off-by-one bug.

Signed-off-by: Paul Moore <paul.moore@hp.com>
---
 net/ipv4/cipso_ipv4.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: net-2.6_bugfix_2/net/ipv4/cipso_ipv4.c
===================================================================
--- net-2.6_bugfix_2.orig/net/ipv4/cipso_ipv4.c
+++ net-2.6_bugfix_2/net/ipv4/cipso_ipv4.c
@@ -832,8 +832,8 @@ static int cipso_v4_map_cat_rbm_hton(con
 
 	switch (doi_def->type) {
 	case CIPSO_V4_MAP_PASS:
-		net_spot_max = host_cat_len - 1;
-		while (net_spot_max > 0 && host_cat[net_spot_max] == 0)
+		net_spot_max = host_cat_len;
+		while (net_spot_max > 0 && host_cat[net_spot_max - 1] == 0)
 			net_spot_max--;
 		if (net_spot_max > net_cat_len)
 			return -EINVAL;

--
paul moore
linux security @ hp

  parent reply	other threads:[~2006-10-11 23:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-11 23:10 [PATCH 0/3] Collection of small NetLabel bugfixes paul.moore
2006-10-11 23:10 ` [PATCH 1/3] NetLabel: only deref the CIPSOv4 standard map fields when using standard mapping paul.moore
2006-10-11 23:10 ` [PATCH 2/3] NetLabel: better error handling involving mls_export_cat() paul.moore
2006-10-11 23:10 ` paul.moore [this message]
2006-10-12 22:35 ` [PATCH 0/3] Collection of small NetLabel bugfixes James Morris

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=20061011231357.321273000@hp.com \
    --to=paul.moore@hp.com \
    --cc=eparis@redhat.com \
    --cc=jmorris@namei.org \
    --cc=netdev@vger.kernel.org \
    --cc=selinux@tycho.nsa.gov \
    /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).