From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB6CCC43381 for ; Fri, 1 Mar 2019 18:32:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A88762084F for ; Fri, 1 Mar 2019 18:32:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b="GHfFqxkM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728336AbfCASca (ORCPT ); Fri, 1 Mar 2019 13:32:30 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39688 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbfCASc3 (ORCPT ); Fri, 1 Mar 2019 13:32:29 -0500 Received: by mail-wr1-f67.google.com with SMTP id l5so26929043wrw.6 for ; Fri, 01 Mar 2019 10:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fix4x79m1ZXS/HhhQP7JydC92dFYKx1Ev9jpjcHs30M=; b=GHfFqxkMB9ZmLaKBd4Ri7Go5t3haenBsfafIBmeU8BP5Ay9PFGtP4kaHUERpSRdBQL ZrxT1zShFEdqNzQVRoApicAe2Vvw0ZZ6sPXHsGD98ZfCpnwaPVKEIJ2P6zx3mZXrFajv IdJp1bTywNdmqpc85vmWBhAd/cjGDfHvCO7p0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fix4x79m1ZXS/HhhQP7JydC92dFYKx1Ev9jpjcHs30M=; b=iWDdXtRPPXxASb44V09kpRpP9fV/QV3Jtj2l1+L/IAo3PH5snxOCCvpBwP6XLXclwd BjBvAFIYLMFXgzB97hq6k7FTEa/qXwm0Bf2mGyIKidaYmxRZX1rXW3Rd6lwvSoPbqscZ XsFxHA58orz6lp5RCBJ+u88vXXq2bkndU4ah0b0sNeD9M/GTD7P89mUPxR5xpA8ObsCl B2hDYWT/UR2ig9R+97YhtufkCtPPHDUMJKJuJOmYRqzXDZOslOiMNTnb9d/GmmcJrMfj dV8J3Yx4QRJHrlyc+cPvMmws8e0xteJGmF3hmV/fgAJKn/xSI4wl28CLrPcRWs2Al8fI vYRQ== X-Gm-Message-State: APjAAAXlxGvAiQL+ktcb3SfbEMTBx2Eh5JzN5DOYmcgfBQZUXvpfL+7v /+1c9L8FPsVrxGuakO4LF7jDgNJJCA0= X-Google-Smtp-Source: APXvYqx+QRTl+Uc5BOk7cC3d/ukeFSQY0nwBGWbvBGQ7rl1ugyblyrpohZO5X2A6vff/gVJo/9BTlQ== X-Received: by 2002:adf:8294:: with SMTP id 20mr4571679wrc.223.1551465148145; Fri, 01 Mar 2019 10:32:28 -0800 (PST) Received: from [192.168.0.107] (79-100-158-105.ip.btc-net.bg. [79.100.158.105]) by smtp.gmail.com with ESMTPSA id x12sm34926314wrs.84.2019.03.01.10.32.27 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 01 Mar 2019 10:32:27 -0800 (PST) Subject: Re: [PATCH net-next] net: ipv4: Fix NULL pointer dereference in route lookup To: Ido Schimmel , "netdev@vger.kernel.org" Cc: "davem@davemloft.net" , "dsahern@gmail.com" , mlxsw , wenxu References: <20190301133810.8107-1-idosch@mellanox.com> From: Nikolay Aleksandrov Message-ID: <83610f14-c31f-283c-a036-d6d8a115772c@cumulusnetworks.com> Date: Fri, 1 Mar 2019 20:32:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190301133810.8107-1-idosch@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 01/03/2019 15:38, Ido Schimmel wrote: > When calculating the multipath hash for input routes the flow info is > not available and therefore should not be used. > > Fixes: 24ba14406c5c ("route: Add multipath_hash in flowi_common to make user-define hash") > Signed-off-by: Ido Schimmel > Cc: wenxu > --- > net/ipv4/route.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ipv4/route.c b/net/ipv4/route.c > index 7cf4c8305071..e3ac458b5d8b 100644 > --- a/net/ipv4/route.c > +++ b/net/ipv4/route.c > @@ -1820,7 +1820,7 @@ static void ip_multipath_l3_keys(const struct sk_buff *skb, > int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4, > const struct sk_buff *skb, struct flow_keys *flkeys) > { > - u32 multipath_hash = fl4->flowi4_multipath_hash; > + u32 multipath_hash = fl4 ? fl4->flowi4_multipath_hash : 0; > struct flow_keys hash_keys; > u32 mhash; > > indeed, missed it during review, thanks! Acked-by: Nikolay Aleksandrov