From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967857AbdDSXrs (ORCPT ); Wed, 19 Apr 2017 19:47:48 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36578 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967779AbdDSXrn (ORCPT ); Wed, 19 Apr 2017 19:47:43 -0400 MIME-Version: 1.0 In-Reply-To: References: <2b60b1b8-4766-0e36-f6fb-79914bf1925d@cumulusnetworks.com> <328b1fa7-2d97-6ae3-3b87-e33a0d564ad9@cumulusnetworks.com> <2270c1ca-9481-60c1-9c29-87669223bded@cumulusnetworks.com> <580392d8-fa33-67bb-c5d6-27d262f1646a@cumulusnetworks.com> From: Cong Wang Date: Wed, 19 Apr 2017 16:47:21 -0700 Message-ID: Subject: Re: net: heap out-of-bounds in fib6_clean_node/rt6_fill_node/fib6_age/fib6_prune_clone To: Andrey Konovalov Cc: David Ahern , Dmitry Vyukov , Eric Dumazet , Mahesh Bandewar , Eric Dumazet , David Miller , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev , LKML , syzkaller Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 19, 2017 at 9:12 AM, Andrey Konovalov 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;