From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968194AbdDSXvx (ORCPT ); Wed, 19 Apr 2017 19:51:53 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:35337 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968143AbdDSXvt (ORCPT ); Wed, 19 Apr 2017 19:51:49 -0400 Subject: Re: net: heap out-of-bounds in fib6_clean_node/rt6_fill_node/fib6_age/fib6_prune_clone To: Cong Wang , Andrey Konovalov References: <328b1fa7-2d97-6ae3-3b87-e33a0d564ad9@cumulusnetworks.com> <2270c1ca-9481-60c1-9c29-87669223bded@cumulusnetworks.com> <580392d8-fa33-67bb-c5d6-27d262f1646a@cumulusnetworks.com> Cc: Dmitry Vyukov , Eric Dumazet , Mahesh Bandewar , Eric Dumazet , David Miller , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev , LKML , syzkaller From: David Ahern Message-ID: <1dad955e-28c1-3f02-8876-90cce4a7d1f8@cumulusnetworks.com> Date: Wed, 19 Apr 2017 17:51:44 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/19/17 5:47 PM, Cong Wang wrote: > 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; > I sent a patch returning EINVAL if RTF_PCPU is set in fc_flags