* [PATCH 2.6.21-stable] [IPV6]: Restore semantics of Routing Header processing.
@ 2007-05-11 16:17 YOSHIFUJI Hideaki / 吉藤英明
2007-05-11 16:22 ` [stable] " Chris Wright
0 siblings, 1 reply; 6+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-05-11 16:17 UTC (permalink / raw)
To: davem; +Cc: netdev, yoshfuji, stable
The "fix" for emerging security threats was overkill and it broke
basic semantic of IPv6 routing header processing. We should assume
RT0 (or even RT2, depends on configuration) as "unknown" RH type so
that we
- silently ignore the routing header if segleft == 0
- or, send ICMPv6 Parameter Problem message back to the sender,
otherwise.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/exthdrs.c | 46 ++++++++++++++++------------------------------
1 files changed, 16 insertions(+), 30 deletions(-)
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 3205ec9..6386dd7 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -368,22 +368,13 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp)
struct rt0_hdr *rthdr;
int accept_source_route = ipv6_devconf.accept_source_route;
- if (accept_source_route < 0 ||
- ((idev = in6_dev_get(skb->dev)) == NULL)) {
- kfree_skb(skb);
- return -1;
- }
- if (idev->cnf.accept_source_route < 0) {
+ idev = in6_dev_get(skb->dev);
+ if (idev) {
+ if (accept_source_route > idev->cnf.accept_source_route)
+ accept_source_route = idev->cnf.accept_source_route;
in6_dev_put(idev);
- kfree_skb(skb);
- return -1;
}
- if (accept_source_route > idev->cnf.accept_source_route)
- accept_source_route = idev->cnf.accept_source_route;
-
- in6_dev_put(idev);
-
if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
!pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
@@ -394,23 +385,6 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp)
hdr = (struct ipv6_rt_hdr *) skb->h.raw;
- switch (hdr->type) {
-#ifdef CONFIG_IPV6_MIP6
- case IPV6_SRCRT_TYPE_2:
- break;
-#endif
- case IPV6_SRCRT_TYPE_0:
- if (accept_source_route > 0)
- break;
- kfree_skb(skb);
- return -1;
- default:
- IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
- IPSTATS_MIB_INHDRERRORS);
- icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->type) - skb->nh.raw);
- return -1;
- }
-
if (ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr) ||
skb->pkt_type != PACKET_HOST) {
IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
@@ -450,6 +424,8 @@ looped_back:
switch (hdr->type) {
case IPV6_SRCRT_TYPE_0:
+ if (accept_source_route <= 0)
+ goto unknown_rh;
if (hdr->hdrlen & 0x01) {
IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
IPSTATS_MIB_INHDRERRORS);
@@ -459,6 +435,8 @@ looped_back:
break;
#ifdef CONFIG_IPV6_MIP6
case IPV6_SRCRT_TYPE_2:
+ if (accept_source_route < 0)
+ goto unknown_rh;
/* Silently discard invalid RTH type 2 */
if (hdr->hdrlen != 2 || hdr->segments_left != 1) {
IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
@@ -468,6 +446,8 @@ looped_back:
}
break;
#endif
+ default:
+ goto unknown_rh;
}
/*
@@ -569,6 +549,12 @@ looped_back:
skb_push(skb, skb->data - skb->nh.raw);
dst_input(skb);
return -1;
+
+unknown_rh:
+ IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS);
+ icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
+ (&hdr->type) - skb->nh.raw);
+ return -1;
}
static struct inet6_protocol rthdr_protocol = {
--
1.5.1
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [stable] [PATCH 2.6.21-stable] [IPV6]: Restore semantics of Routing Header processing.
2007-05-11 16:17 [PATCH 2.6.21-stable] [IPV6]: Restore semantics of Routing Header processing YOSHIFUJI Hideaki / 吉藤英明
@ 2007-05-11 16:22 ` Chris Wright
2007-05-11 16:28 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 1 reply; 6+ messages in thread
From: Chris Wright @ 2007-05-11 16:22 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明
Cc: davem, netdev, stable
* YOSHIFUJI Hideaki / 吉藤英明 (yoshfuji@linux-ipv6.org) wrote:
> The "fix" for emerging security threats was overkill and it broke
> basic semantic of IPv6 routing header processing. We should assume
> RT0 (or even RT2, depends on configuration) as "unknown" RH type so
> that we
> - silently ignore the routing header if segleft == 0
> - or, send ICMPv6 Parameter Problem message back to the sender,
> otherwise.
Does that mean this one has received testing and is good for -stable
now, or does it need some bake time?
thanks,
-chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [stable] [PATCH 2.6.21-stable] [IPV6]: Restore semantics of Routing Header processing.
2007-05-11 16:22 ` [stable] " Chris Wright
@ 2007-05-11 16:28 ` YOSHIFUJI Hideaki / 吉藤英明
2007-05-11 16:29 ` Chris Wright
2007-05-17 1:46 ` Chris Wright
0 siblings, 2 replies; 6+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-05-11 16:28 UTC (permalink / raw)
To: chrisw, davem; +Cc: netdev, stable
In article <20070511162243.GC3516@sequoia.sous-sol.org> (at Fri, 11 May 2007 09:22:43 -0700), Chris Wright <chrisw@sous-sol.org> says:
> * YOSHIFUJI Hideaki / 吉藤英明 (yoshfuji@linux-ipv6.org) wrote:
> > The "fix" for emerging security threats was overkill and it broke
> > basic semantic of IPv6 routing header processing. We should assume
> > RT0 (or even RT2, depends on configuration) as "unknown" RH type so
> > that we
> > - silently ignore the routing header if segleft == 0
> > - or, send ICMPv6 Parameter Problem message back to the sender,
> > otherwise.
>
> Does that mean this one has received testing and is good for -stable
> now, or does it need some bake time?
Chris, I think it is okay, but
please wait for Dave's approval.
Thanks.
--yoshfuji
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [stable] [PATCH 2.6.21-stable] [IPV6]: Restore semantics of Routing Header processing.
2007-05-11 16:28 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2007-05-11 16:29 ` Chris Wright
2007-05-17 1:46 ` Chris Wright
1 sibling, 0 replies; 6+ messages in thread
From: Chris Wright @ 2007-05-11 16:29 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明
Cc: chrisw, davem, netdev, stable
* YOSHIFUJI Hideaki / 吉藤英明 (yoshfuji@linux-ipv6.org) wrote:
> Chris, I think it is okay, but
> please wait for Dave's approval.
Alright, will do.
thanks,
-chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [stable] [PATCH 2.6.21-stable] [IPV6]: Restore semantics of Routing Header processing.
2007-05-11 16:28 ` YOSHIFUJI Hideaki / 吉藤英明
2007-05-11 16:29 ` Chris Wright
@ 2007-05-17 1:46 ` Chris Wright
[not found] ` <20070516.191013.102573773.davem@davemloft.net>
1 sibling, 1 reply; 6+ messages in thread
From: Chris Wright @ 2007-05-17 1:46 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明
Cc: chrisw, davem, netdev, stable
* YOSHIFUJI Hideaki / 吉藤英明 (yoshfuji@linux-ipv6.org) wrote:
> In article <20070511162243.GC3516@sequoia.sous-sol.org> (at Fri, 11 May 2007 09:22:43 -0700), Chris Wright <chrisw@sous-sol.org> says:
> > * YOSHIFUJI Hideaki / 吉藤英明 (yoshfuji@linux-ipv6.org) wrote:
> > > The "fix" for emerging security threats was overkill and it broke
> > > basic semantic of IPv6 routing header processing. We should assume
> > > RT0 (or even RT2, depends on configuration) as "unknown" RH type so
> > > that we
> > > - silently ignore the routing header if segleft == 0
> > > - or, send ICMPv6 Parameter Problem message back to the sender,
> > > otherwise.
> >
> > Does that mean this one has received testing and is good for -stable
> > now, or does it need some bake time?
>
> Chris, I think it is okay, but
> please wait for Dave's approval.
Any update on this one?
thanks,
-chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [stable] [PATCH 2.6.21-stable] [IPV6]: Restore semantics of Routing Header processing.
[not found] ` <20070516.191013.102573773.davem@davemloft.net>
@ 2007-05-17 2:12 ` Chris Wright
0 siblings, 0 replies; 6+ messages in thread
From: Chris Wright @ 2007-05-17 2:12 UTC (permalink / raw)
To: David Miller; +Cc: chrisw, yoshfuji, netdev, stable
* David Miller (davem@davemloft.net) wrote:
> We're not pushing this in, even the ipv6 working group is unsure
> how this should be handled and one of the possibilities they might
> choose matches how things currently are.
Alright, I'll drop this one from the -stable radar, thanks.
-chris
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-05-17 2:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-11 16:17 [PATCH 2.6.21-stable] [IPV6]: Restore semantics of Routing Header processing YOSHIFUJI Hideaki / 吉藤英明
2007-05-11 16:22 ` [stable] " Chris Wright
2007-05-11 16:28 ` YOSHIFUJI Hideaki / 吉藤英明
2007-05-11 16:29 ` Chris Wright
2007-05-17 1:46 ` Chris Wright
[not found] ` <20070516.191013.102573773.davem@davemloft.net>
2007-05-17 2:12 ` Chris Wright
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).