lkml.org 
[lkml]   [2017]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: net: heap out-of-bounds in fib6_clean_node/rt6_fill_node/fib6_age/fib6_prune_clone
On Wed, Apr 19, 2017 at 9:12 AM, Andrey Konovalov <andreyknvl@google.com> wrote:
>
> Anyway, I just finished simplifying the reproducer. Give this one a try.

Thanks for providing such a minimal reproducer!

The following patch could fix this crash, but I am not 100% sure if we should
just clear these bits or reject them with an errno.

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 9db14189..cf524c2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2086,7 +2086,7 @@ static struct rt6_info
*ip6_route_info_create(struct fib6_config *cfg)
} else
rt->rt6i_prefsrc.plen = 0;

- rt->rt6i_flags = cfg->fc_flags;
+ rt->rt6i_flags = cfg->fc_flags & ~(RTF_PCPU | RTF_CACHE);

install_route:
rt->dst.dev = dev;
\
 
 \ /
  Last update: 2017-04-20 01:48    [W:0.086 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site