Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5760964imm; Mon, 23 Jul 2018 05:44:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcflDScCXGlgFYNzmZE49iEZbzqqLQlkVXtX5lr5isFGMQhE8lEMAkfuyxKkIqrx0iGXnXR X-Received: by 2002:a17:902:9687:: with SMTP id n7-v6mr12483949plp.33.1532349874820; Mon, 23 Jul 2018 05:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532349874; cv=none; d=google.com; s=arc-20160816; b=Va/o/HziNEq1/RBwsOhgeILFN7P4y1W9M9IPFEuGw7qZfMCfglPEnpq9aLkO6tp2q2 0Yr0U9n3BbVyqU8Ts7Rl8AEpedMO7CPfj01nQcFTPttqZ6fHcnbtx9v+FNhds1ec28QL K4erF2+J9yRKhWFBFES9egnkqveBYoWUaKxDrBA1wSUyLuS2HU2Y0+taFlBEmqqD/oUV CYIPuOQrgjstADRNElPVB1GvPFC7ACRBtcGGXLcFOVvG87qMQ0TJvLscN7J8D7OdgObe rZNzX36IAHLiT58hDsleKbCwZt5kk3h5W42ZwO2oAZyLdQV4ycr3ATRwR7LUS5sdbWJ1 d0HA== 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=YYLJnMEfP4GHYIvvb61z5I4Aj3tPHj/Voy2nqgLlE7A=; b=CKTMLhayZ7viqQ4aehYaqxdKdK/mVYgNWPxyQ0sjCZI5EH7Xmf93B1t3UAA1hHAVp0 KUpZ66HZRbRQXC8gLex2vE+BcjZ+tmOp62CWdEyxkfFG9bLBXOkaJ9H4oJAIRxHo0mwZ 03PPQVx6gNXVgNBXPKV1uWiR6CKHhviz8Gp9T6tiZepkgrVxV1k4BgqEGEWLR6jejz/0 4E5F30FOCloUqxYKES0eE7ECHOw+RFLtyCPl0Hw7KODAOErzR9bm3gw78Ji0q1wUZZAs +OK23621cK+ulVM7IV0l1CBH8bc/Bfx7SBisRmTAVa9DWycumaF9HgSaZRdv9FeSyeLg 2/DQ== 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 38-v6si8862919pgz.286.2018.07.23.05.44.20; Mon, 23 Jul 2018 05:44:34 -0700 (PDT) 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 S2388606AbeGWNn5 (ORCPT + 99 others); Mon, 23 Jul 2018 09:43:57 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47620 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388251AbeGWNn4 (ORCPT ); Mon, 23 Jul 2018 09:43:56 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7667440B; Mon, 23 Jul 2018 12:42:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , David Ahern , "David S. Miller" Subject: [PATCH 4.4 011/107] net/ipv4: Set oif in fib_compute_spec_dst Date: Mon, 23 Jul 2018 14:41:05 +0200 Message-Id: <20180723122413.418336867@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180723122413.003644357@linuxfoundation.org> References: <20180723122413.003644357@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Ahern [ Upstream commit e7372197e15856ec4ee66b668020a662994db103 ] Xin reported that icmp replies may not use the address on the device the echo request is received if the destination address is broadcast. Instead a route lookup is done without considering VRF context. Fix by setting oif in flow struct to the master device if it is enslaved. That directs the lookup to the VRF table. If the device is not enslaved, oif is still 0 so no affect. Fixes: cd2fbe1b6b51 ("net: Use VRF device index for lookups on RX") Reported-by: Xin Long Signed-off-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/fib_frontend.c | 1 + 1 file changed, 1 insertion(+) --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -297,6 +297,7 @@ __be32 fib_compute_spec_dst(struct sk_bu if (!ipv4_is_zeronet(ip_hdr(skb)->saddr)) { struct flowi4 fl4 = { .flowi4_iif = LOOPBACK_IFINDEX, + .flowi4_oif = l3mdev_master_ifindex_rcu(dev), .daddr = ip_hdr(skb)->saddr, .flowi4_tos = RT_TOS(ip_hdr(skb)->tos), .flowi4_scope = scope,