Skip to contentSkip to conversation

net: igmp: fix source address check for IGMPv3 reports

PATCH Applied Felix Fietkau 2 participants 4 messages Jan 19, 2018 – Jan 23, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: igmp: fix source address check for IGMPv3 reports

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 <[email protected]>
Fixes a46182b00290 ("net: igmp: Use correct source address on IGMPv3 reports")
---
 net/ipv4/igmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/igmp.c +1 -1
index 726f6b608274..2d49717a7421 100644
@@ -332,7 +332,7 @@ static __be32 igmpv3_get_srcaddr(struct net_device *dev,
 		return htonl(INADDR_ANY);
 
 	for_ifa(in_dev) {
-		if (inet_ifa_match(fl4->saddr, ifa))
+		if (fl4->saddr == ifa->ifa_local)
 			return fl4->saddr;
 	} endfor_ifa(in_dev);
 
Signature · 1 line
2.14.2
maintainer Applied
#1 lore raw

From: Felix Fietkau <[email protected]>
Date: Fri, 19 Jan 2018 11:50:46 +0100

Quoted 7 lines

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).

Quoted 7 lines

This breaks for point-to-point interfaces, so check against ifa->ifa_local directly.

Cc Kevin Cernekee <[email protected]>
Fixes a46182b00290 ("net: igmp: Use correct source address on IGMPv3 reports")

Applied, thanks.

#2 lore raw
Quoted 13 lines · David Miller

From: Felix Fietkau <[email protected]>
Date: Fri, 19 Jan 2018 11:50:46 +0100

Quoted 10 lines

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.

Quoted 6 lines
Quoted 4 lines
Cc Kevin Cernekee <[email protected]>
Fixes a46182b00290 ("net: igmp: Use correct source address on IGMPv3 reports")

Applied, thanks.

Thanks. Please queue it up for stable as well, since the commit fixed by this patch has already made it to stable kernels.

- Felix

maintainer
#3 lore raw

From: Felix Fietkau <[email protected]>
Date: Tue, 23 Jan 2018 10:48:59 +0100

Quoted 14 lines · David Miller
Quoted 13 lines

From: Felix Fietkau <[email protected]>
Date: Fri, 19 Jan 2018 11:50:46 +0100

Quoted 10 lines

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.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Cc Kevin Cernekee <[email protected]>
Fixes a46182b00290 ("net: igmp: Use correct source address on IGMPv3 reports")

Applied, thanks.

Thanks. Please queue it up for stable as well, since the commit fixed by this patch has already made it to stable kernels.

I did, thank you.