Skip to contentSkip to conversation

ipv4: initialise the itag variable in __mkroute_input

PATCH In review [email protected] 5 participants 6 messages May 22, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv4: initialise the itag variable in __mkroute_input

From: Li RongQing <[email protected]>

the value of itag is a random value from stack, and may not be initiated by fib_validate_source, which called fib_combine_itag if CONFIG_IP_ROUTE_CLASSID is not set

This will make the cached dst uncertainty

---
 net/ipv4/route.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/route.c +1 -1
index 50e1e0f..4154eb7 100644
@@ -1526,7 +1526,7 @@ static int __mkroute_input(struct sk_buff *skb,
 	struct in_device *out_dev;
 	unsigned int flags = 0;
 	bool do_cache;
-	u32 itag;
+	u32 itag = 0;
 
 	/* get a working reference to the output device */
 	out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res));
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Thu, May 22, 2014 at 1:36 AM, <[email protected]> wrote:

From: Li RongQing <[email protected]>

the value of itag is a random value from stack, and may not be initiated by fib_validate_source, which called fib_combine_itag if CONFIG_IP_ROUTE_CLASSID is not set

This will make the cached dst uncertainty

Nice catch. Indeed. I think it's needed for stable.

Dormando,
can you check whether your config has CONFIG_IP_ROUTE_CLASSID or not? The way I'm reading the code, it shouldn't be causing your failures, but that part
of code is hairy..

Quoted 24 lines
---
 net/ipv4/route.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/route.c +1 -2
index 50e1e0f..4154eb7 100644
@@ -1526,7 +1526,7 @@ static int __mkroute_input(struct sk_buff *skb,
        struct in_device *out_dev;
        unsigned int flags = 0;
        bool do_cache;
-       u32 itag;
+       u32 itag = 0;
 
        /* get a working reference to the output device */
        out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res));
--

1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 13 lines · Alexei Starovoitov
Quoted 9 lines · On Thu, May 22, 2014 at 1:36 AM, <[email protected]> wrote:

From: Li RongQing <[email protected]>

the value of itag is a random value from stack, and may not be initiated by fib_validate_source, which called fib_combine_itag if CONFIG_IP_ROUTE_CLASSID is not set

This will make the cached dst uncertainty

Nice catch. Indeed. I think it's needed for stable.

Quoted 7 lines

Dormando,
can you check whether your config has CONFIG_IP_ROUTE_CLASSID or not? The way I'm reading the code, it shouldn't be causing your failures, but that part
of code is hairy..

CONFIG_IP_ROUTE_CLASSID=y

There're a lot of negatives in that description, but if this patch only affects you if CONFIG_IP_ROUTE_CLASSID=n?

Quoted 25 lines
Quoted 24 lines
---
 net/ipv4/route.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/route.c +1 -2
index 50e1e0f..4154eb7 100644
@@ -1526,7 +1526,7 @@ static int __mkroute_input(struct sk_buff *skb,
        struct in_device *out_dev;
        unsigned int flags = 0;
        bool do_cache;
-       u32 itag;
+       u32 itag = 0;
 
        /* get a working reference to the output device */
        out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res));
--

1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 4 lines · dormando

CONFIG_IP_ROUTE_CLASSID=y

There're a lot of negatives in that description, but if this patch only affects you if CONFIG_IP_ROUTE_CLASSID=n?

Yep

Have you tried Linus fix for pipes ? (commit b0d8d2292160bb63de1972361ebed100c64b5b37 )

#4 lore raw
Quoted 4 lines · Eric Dumazet
Quoted 2 lines · dormando

CONFIG_IP_ROUTE_CLASSID=y

Quoted 11 lines
Quoted 2 lines

There're a lot of negatives in that description, but if this patch only affects you if CONFIG_IP_ROUTE_CLASSID=n?

Yep

Have you tried Linus fix for pipes ? (commit b0d8d2292160bb63de1972361ebed100c64b5b37 )

Nope. git describe says that's a 3.13 change. I saw that 3.14 is getting the LTS treatment, so I'm going to rebase our patchset and try to get that in testing.

I don't think the pipe fix would get all of our bugs though, maybe the kmem one. Which would be nice.