Received: by 10.223.185.116 with SMTP id b49csp5456952wrg; Wed, 7 Mar 2018 12:05:14 -0800 (PST) X-Google-Smtp-Source: AG47ELsSY90py4GNtxe4J2lT9zJ94IItM0UV9WiDororqZ1BX1QTmGrKPRt+A0EsVFn1Hw+EZMIQ X-Received: by 10.98.75.129 with SMTP id d1mr23877162pfj.19.1520453114663; Wed, 07 Mar 2018 12:05:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520453114; cv=none; d=google.com; s=arc-20160816; b=ZRYUGo9No/4wqNcpTYBz/vx73458y8o3fVX3UWxQESbUer/2JUZoBX+gCrqu66Ynci y0w9ilBEczxJwxPpgtcBHL2yboYG8cfvgBFY3FLV4yQAaxPYI3NOQQZSWSwd9QfFkHV/ 7FiVZdzUHg8yLacLpKPJyfKn0ofTrHsBVEGDaZYxSYChVDLdTtKOaVtzJQI+H1DGFsiY tZklEi8xsQKkHO3QI2DzqCJQegTBvUKw2BX3ZcLTNMUylIkg8vuqa6Mcvz25axcZSl9X Zjxvw/P1RZaKrpgJhwAZN6wC8S3oBr+z6yvrWpNHKOcb/nF0LryHgIW9AgqDAP1699yD kIOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=UwF8tTKD8BupD7+siWD5ruQgT+EaaaMQ94OJPaYf+8E=; b=eQRWKae0XPBKT1MZYYZTMW8etpnEsQAJQ3+cmTRmC0BhbXdguCD96ih8cMYOq1a40+ 61wvTjDVZGLkbzbxjHxmjYcdVxW0rz9vaH4Eq3NoB0dbWBKqiWXUWz8NdraR6G/hNFJ9 Ompi7vRvsHHaWfmcuRfJxtKxGAwE70u2J0xGKR1WWiRqfzaRyXsBpBSde7jMHVnYVo7H c7YmsVR58SmehlR62hetuYQ+SLDTcsvUzDb31D9DccOWNbRKRdh1a1Peo6EId3kja1GL GZPC5A+rOsQQJI7Z0eYrN0Z3U/JeJm563qFQf6pzNTZKv6KNTQNsfyK2rM8X3YN/tzit 7xFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6-v6si13381414plh.287.2018.03.07.12.05.00; Wed, 07 Mar 2018 12:05:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965558AbeCGUED (ORCPT + 99 others); Wed, 7 Mar 2018 15:04:03 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44628 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965539AbeCGTqa (ORCPT ); Wed, 7 Mar 2018 14:46:30 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id ABDC7107A; Wed, 7 Mar 2018 19:46:29 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ido Schimmel , David Ahern , Nikolay Aleksandrov , Ido Schimmel , "David S. Miller" Subject: [PATCH 4.14 063/110] net: ipv4: Set addr_type in hash_keys for forwarded case Date: Wed, 7 Mar 2018 11:38:46 -0800 Message-Id: <20180307191047.652583652@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Ahern [ Upstream commit 1fe4b1184c2ae2bfbf9e8b14c9c0c1945c98f205 ] The result of the skb flow dissect is copied from keys to hash_keys to ensure only the intended data is hashed. The original L4 hash patch overlooked setting the addr_type for this case; add it. Fixes: bf4e0a3db97eb ("net: ipv4: add support for ECMP hash policy choice") Reported-by: Ido Schimmel Signed-off-by: David Ahern Acked-by: Nikolay Aleksandrov Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/route.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1832,6 +1832,8 @@ int fib_multipath_hash(const struct fib_ return skb_get_hash_raw(skb) >> 1; memset(&hash_keys, 0, sizeof(hash_keys)); skb_flow_dissect_flow_keys(skb, &keys, flag); + + hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS; hash_keys.addrs.v4addrs.src = keys.addrs.v4addrs.src; hash_keys.addrs.v4addrs.dst = keys.addrs.v4addrs.dst; hash_keys.ports.src = keys.ports.src;