lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTim_gutzLcL74aDVPJxFyRXi4x9rKJijBRHNVVog@mail.gmail.com>
Date:	Wed, 3 Nov 2010 22:46:42 +0100
From:	Michał Mirosław <mirqus@...il.com>
To:	Jesse Gross <jesse@...ira.com>
Cc:	Timo Teräs <timo.teras@....fi>,
	netdev@...r.kernel.org, Herbert Xu <herbert@...dor.apana.org.au>
Subject: Re: [PATCH] xfrm: use gre key as flow upper protocol info

W dniu 3 listopada 2010 22:35 użytkownik Jesse Gross <jesse@...ira.com> napisał:
> 2010/11/3 Michał Mirosław <mirqus@...il.com>:
>> 2010/11/3 Timo Teräs <timo.teras@....fi>:
>>> The GRE Key field is intended to be used for identifying an individual
>>> traffic flow within a tunnel. It is useful to be able to have XFRM
>>> policy selector matches to have different policies for different
>>> GRE tunnels.
>> [...]
>>> diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
>>> index 4464f3b..57af4bd 100644
>>> --- a/net/ipv4/xfrm4_policy.c
>>> +++ b/net/ipv4/xfrm4_policy.c
>>> @@ -158,6 +159,20 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
>>>                                fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1]));
>>>                        }
>>>                        break;
>>> +
>>> +               case IPPROTO_GRE:
>>> +                       if (pskb_may_pull(skb, xprth + 12 - skb->data)) {
>>> +                               __be16 *greflags = (__be16 *)xprth;
>>> +                               __be32 *gre_hdr = (__be32 *)xprth;
>>> +
>>> +                               if (greflags[0] & GRE_KEY) {
>>> +                                       if (greflags[0] & GRE_CSUM)
>>> +                                               gre_hdr++;
>>> +                                       fl->fl_gre_key = gre_hdr[1];
>>> +                               }
>>> +                       }
>>> +                       break;
>>> +
>>>                default:
>>>                        fl->fl_ipsec_spi = 0;
>>>                        break;
>> I would expect that keyless tunnel would be separate from key 0 tunnel.
> No key and key 0 are generally treated the same.  Both will match the
> same tunnel when doing the lookup in the GRE receive path.

I read the code again, and indeed it is. I was sure that they were
treated separately some time ago, but git knows nothing about it.

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ