Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2761192imj; Mon, 11 Feb 2019 08:05:39 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia/VdI6VT9+7FqXEu6o+VAAmiqp9aYvs+syhsXEIeXWbv2PUYc7B5uyTikdOVe28ASdiU5g X-Received: by 2002:a62:5884:: with SMTP id m126mr37343969pfb.177.1549901138927; Mon, 11 Feb 2019 08:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901138; cv=none; d=google.com; s=arc-20160816; b=fouQLBfrK2hqi0bjJCSOiV1eTaRssPYVCLnpVAvo7UyZwyxTjnYLhweu7p9Gi03LtH lTMPr8RSq6XcIOdOQvh7aQkufwAWo0f2MJqte9znr+p854hUXMz1+XUL+P7UJRfAXZ/Z 7nzeqAY4HlCfFHQnnhs3kiM9c29+l49WX2V9rf1b15N2xh1IYT2nj4pDw+VnPqOpQO+j 0CfHWQH8pv8y3jauNLOi00EaYrHdJBHJUQVZrY8f4Ky+MvIrrZWfIQYo9AwlguDfgXM/ OtlBFmTkqe9BRf1CpbztoaASj2ZB4lw8zYoFlCHDg6es5H5G/neFeBuPVt+EhqHYVoPo pa6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vyONBU+xZH1JMvfX7ethDGvVBTtNJSPX2sA8DmP4NSY=; b=uWmSpWWmXkPdumBWxbTKKkDdNHjPf5iXUNum0huRIKei6Ikojwsw8M+3kvrerc5BRc ne3nukOgIJriZ5a4iBdEn0FQroJQap7MLtU139n9Sg4y2gg80j5W9O3HRQh5PkDUKgzv Gs+jiD9dc+G3qeMsxqfr4eqZL/jvFhgwH3sbQuJ6AIvNJ5WaJaQKpHnDUnvp93fdxwpF QTPMW9YWOZROYjsEh26Le71lfsiKbXLMvfbRHut1xKhfs00JXUEtlZhDNruumqKIrwdF 46mcdmFPo1aiY5BEVzKM05thFX0BakAUscQv0KN6f2+aSMANxRBLDqoaD4JUKoQhrAFk KlYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S5NnkctP; 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 37si9750192pgy.70.2019.02.11.08.05.15; Mon, 11 Feb 2019 08:05:38 -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; dkim=pass header.i=@kernel.org header.s=default header.b=S5NnkctP; 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 S1729931AbfBKQEN (ORCPT + 99 others); Mon, 11 Feb 2019 11:04:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:34764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728638AbfBKO2r (ORCPT ); Mon, 11 Feb 2019 09:28:47 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 954982075C; Mon, 11 Feb 2019 14:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895327; bh=JiNB4qYG5B9PnF2Izhq51ABOQs3lGHRLd5wDxYwstd4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S5NnkctPDX+Gf4KWTN9HvqA6pGaPywxThhw7WiKwmfLOgbXOmFqZLNKTrVom6BDY7 P4J0VNQkH3D/EVq8S8F2HiL4O6tlcOvjXoEIIPl0FTgzJ1ZOGNYUNJzcHPRSqVXXuW qDFgvbq1wAETgO8QEoDQFOFpIb68RHe2ET8ZCnsk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Donald Sharp , Mike Manning , David Ahern , "David S. Miller" , Sasha Levin Subject: [PATCH 4.20 168/352] ipv6: Fix handling of LLA with VRF and sockets bound to VRF Date: Mon, 11 Feb 2019 15:16:35 +0100 Message-Id: <20190211141857.701933826@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit c2027d1e17582903e368abf5d4838b22a98f2b7b ] A recent commit allows sockets bound to a VRF to receive ipv6 link local packets. However, it only works for UDP and worse TCP connection attempts to the LLA with the only listener bound to the VRF just hang where as before the client gets a reset and connection refused. Fix by adjusting ir_iif for LL addresses and packets received through a device enslaved to a VRF. Fixes: 6f12fa775530 ("vrf: mark skb for multicast or link-local as enslaved to VRF") Reported-by: Donald Sharp Cc: Mike Manning Signed-off-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv6/tcp_ipv6.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 03e6b7a2bc53..f5c213001b05 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -734,6 +734,7 @@ static void tcp_v6_init_req(struct request_sock *req, const struct sock *sk_listener, struct sk_buff *skb) { + bool l3_slave = ipv6_l3mdev_skb(TCP_SKB_CB(skb)->header.h6.flags); struct inet_request_sock *ireq = inet_rsk(req); const struct ipv6_pinfo *np = inet6_sk(sk_listener); @@ -741,7 +742,7 @@ static void tcp_v6_init_req(struct request_sock *req, ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr; /* So that link locals have meaning */ - if (!sk_listener->sk_bound_dev_if && + if ((!sk_listener->sk_bound_dev_if || l3_slave) && ipv6_addr_type(&ireq->ir_v6_rmt_addr) & IPV6_ADDR_LINKLOCAL) ireq->ir_iif = tcp_v6_iif(skb); -- 2.19.1