Return-Path: Received: from mail-bn3nam01on0117.outbound.protection.outlook.com ([104.47.33.117]:24244 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032005AbeCAPbh (ORCPT ); Thu, 1 Mar 2018 10:31:37 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Felix Fietkau , "David S . Miller" , Sasha Levin Subject: [added to the 4.1 stable tree] net: igmp: fix source address check for IGMPv3 reports Date: Thu, 1 Mar 2018 15:25:00 +0000 Message-ID: <20180301152116.1486-240-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Felix Fietkau This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit ad23b750933ea7bf962678972a286c78a8fa36aa ] Commit "net: igmp: Use correct source address on IGMPv3 reports" introduced a check to validate the source address of locally generated IGMPv3 packets. Instead of checking the local interface address directly, it uses inet_ifa_match(fl4->saddr, ifa), which checks if the address is on the local subnet (or equal to the point-to-point address if used). This breaks for point-to-point interfaces, so check against ifa->ifa_local directly. Cc: Kevin Cernekee Fixes: a46182b00290 ("net: igmp: Use correct source address on IGMPv3 repor= ts") Reported-by: Sebastian Gottschall Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/igmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 0e9d61bf8685..7d8121acac74 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -330,7 +330,7 @@ static __be32 igmpv3_get_srcaddr(struct net_device *dev= , return htonl(INADDR_ANY); =20 for_ifa(in_dev) { - if (inet_ifa_match(fl4->saddr, ifa)) + if (fl4->saddr =3D=3D ifa->ifa_local) return fl4->saddr; } endfor_ifa(in_dev); =20 --=20 2.14.1