All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Patrick McHardy <kaber@trash.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@redhat.com>,
	netdev@oss.sgi.com, ipsec-tools-devel@lists.sourceforge.net
Subject: Re: [PATCH 2.6]: Check against correct policy list in ip_forward/ip6_forward
Date: Mon, 18 Oct 2004 00:42:07 +0200	[thread overview]
Message-ID: <4172F53F.2040808@trash.net> (raw)
In-Reply-To: <4172F1AB.4020305@trash.net>

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

Patrick McHardy wrote:

> Thanks, I didn't know pluto uses the xfrm_user interface, so
> I only looked for pfkey symbolic names. So it seems only racoon
> needs to be fixed. I think we should apply the attached patch
> to make xfrm_policy_check reject packets decapsulated by IPsec
> without a policy for this direction, so people will notice
> something is wrong. It also prevents skipping checks against the
> socket policy if there is an empty policy list .. or am I missing
> something ?

Obsiously I did :) This patch should be better.

> Regards
> Patrick
>
>--- a/include/net/xfrm.h	2004-10-18 00:15:18 +02:00
>+++ b/include/net/xfrm.h	2004-10-18 00:15:18 +02:00
>@@ -601,7 +601,7 @@
> 	if (sk && sk->sk_policy[XFRM_POLICY_IN])
> 		return __xfrm_policy_check(sk, dir, skb, family);
> 		
>-	return	!xfrm_policy_list[dir] ||
>+	return	((!sk || !sk->sk_policy[dir]) && !xfrm_policy_list[dir] && !skb->sp) ||
> 		(skb->dst->flags & DST_NOPOLICY) ||
> 		__xfrm_policy_check(sk, dir, skb, family);
> }
>  
>


[-- Attachment #2: x --]
[-- Type: text/plain, Size: 450 bytes --]

===== include/net/xfrm.h 1.68 vs edited =====
--- 1.68/include/net/xfrm.h	2004-09-10 23:35:53 +02:00
+++ edited/include/net/xfrm.h	2004-10-18 00:41:28 +02:00
@@ -601,7 +601,7 @@
 	if (sk && sk->sk_policy[XFRM_POLICY_IN])
 		return __xfrm_policy_check(sk, dir, skb, family);
 		
-	return	!xfrm_policy_list[dir] ||
+	return	(!xfrm_policy_list[dir] && !skb->sp) ||
 		(skb->dst->flags & DST_NOPOLICY) ||
 		__xfrm_policy_check(sk, dir, skb, family);
 }

  reply	other threads:[~2004-10-17 22:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-17 15:48 [PATCH 2.6]: Check against correct policy list in ip_forward/ip6_forward Patrick McHardy
2004-10-17 21:23 ` Herbert Xu
2004-10-17 22:26   ` Patrick McHardy
2004-10-17 22:42     ` Patrick McHardy [this message]
2004-10-17 23:12     ` Herbert Xu
2004-10-18 20:34       ` Patrick McHardy
2004-10-18 21:43         ` [XFRM] Allow transport SAs even when there is no policy Herbert Xu
2004-10-19 14:16           ` Patrick McHardy
2004-10-19 21:25             ` Herbert Xu
2004-10-21  5:04               ` David S. Miller
2004-10-21  5:02           ` David S. Miller
2004-10-19 15:31       ` [Ipsec-tools-devel] Re: [PATCH 2.6]: Check against correct policy list in ip_forward/ip6_forward Aidas Kasparas
2004-10-19 15:38         ` Patrick McHardy
2004-10-19 15:57           ` Aidas Kasparas
2004-10-19 21:26         ` Herbert Xu

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=4172F53F.2040808@trash.net \
    --to=kaber@trash.net \
    --cc=davem@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=ipsec-tools-devel@lists.sourceforge.net \
    --cc=netdev@oss.sgi.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.