Path: csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod From: Andrey Konovalov Newsgroups: linux.kernel Subject: Re: net: heap out-of-bounds in fib6_clean_node/rt6_fill_node/fib6_age/fib6_prune_clone Date: Thu, 20 Apr 2017 14:20:01 +0200 Message-ID: References: X-Original-To: Dmitry Vyukov Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OKw3KgTF5v/ZNm7U9A05V1eOQHBbWzdsQ8RUsn8Ef8c=; b=WSNDz9h3SjcaqlXI5/JquOFvqOtr+1KEt0DW1kj8a4Kkdz48ZkCIfBdj4zaCVxhlHa G3WqNJYrxAcEC3MsRHy5u1Deq6kIdHGc4DxkboihDbUn929JBXdLSUmdQpI6PRk7Osnj Pozfd+fsE4nJwWzAicge5khzKk3QoaR9Ja+U9SZc1T7ZGUCQSp9DoSFMVWvYvrgAmqR4 TlADX5D0Bw3PLy9qsAArpmHbHcBZKIXNkGoMn3U/D/Xj/o/OLO/YlMZV8EFKuKdG4HD4 y1Lu+OYdFPd/eDCr1jTT0d73+N3AF42aZaLBkAOUAlaTSQ0bc9GDlsaWUgzfCiBpToZZ U+9A== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OKw3KgTF5v/ZNm7U9A05V1eOQHBbWzdsQ8RUsn8Ef8c=; b=fzA+965IULv0Lbq5Hu/KN2eQjiwNCEXnoGgoY8YBXiNsTHLiVdsQRiyi7N6+drkp9P 9YZiZWCiRkd2dVSgIcEO1odvE/o+kaPKwhJmPdBEB48XWT4TUnPL/A9YiUcXShLE5kc1 EAs4kstRwV+k4FPX5eBprZQVi7D2zCkqRBrz1XUzaOFhMI3BN7V0FJ4UlqLZIti02c0S MFsE9FuLxz2/PgXEEx0LQC4kvknSq64sTzh+FWs6Ggxq53OWrWxUEAcCTxIUWir6NXlo 0+A/hu91NY36bqlEdZkc2sSBvRe2KKptNYjVFgfnT5PFpuUJ7KMLHnavodrktQGT8mCE N/oA== X-Gm-Message-State: AN3rC/5UDRwUSPOpCmUmBSvwPHyHVhQuxODUUhEFOtLCBUDaMfS6vv6J Kdfx4i3kYx0DnPJGsYrpjME1lHJoSR49 X-Received: by 10.84.222.12 with SMTP id w12mr10140929pls.115.1492690203953; Thu, 20 Apr 2017 05:10:03 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 36 Organization: linux.* mail to news gateway X-Original-Cc: David Ahern , Cong Wang , Eric Dumazet , Mahesh Bandewar , Eric Dumazet , David Miller , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev , LKML , syzkaller X-Original-Date: Thu, 20 Apr 2017 14:10:03 +0200 X-Original-Message-ID: X-Original-References: <328b1fa7-2d97-6ae3-3b87-e33a0d564ad9@cumulusnetworks.com> <2270c1ca-9481-60c1-9c29-87669223bded@cumulusnetworks.com> <580392d8-fa33-67bb-c5d6-27d262f1646a@cumulusnetworks.com> <1dad955e-28c1-3f02-8876-90cce4a7d1f8@cumulusnetworks.com> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1627404 On Thu, Apr 20, 2017 at 10:35 AM, Dmitry Vyukov wrote: > On Thu, Apr 20, 2017 at 1:51 AM, David Ahern wrote: >> 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 > > > Andrey, does it fix the other crashes? No, still see them. I'm working on reproducing those.