Skip to contentSkip to conversation

ipvs: do not schedule icmp errors from tunnels

PATCH Applied Julian Anastasov 3 participants 4 messages Mar 31, 2019 – Apr 13, 2019

Subsystems (3)
lore
Share & tools
lore

Julian Anastasov

author maintainer
#0 lore raw

PATCH 1/1 ipvs: do not schedule icmp errors from tunnels

We can receive ICMP errors from client or from
tunneling real server. While the former can be
scheduled to real server, the latter should
not be scheduled, they are decapsulated only when
existing connection is found.

Fixes 6044eeffafbe ("ipvs: attempt to schedule icmp packets")
---
 net/netfilter/ipvs/ip_vs_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_core.c +1 -1
index 43bbaa32b1d6..14457551bcb4 100644
@@ -1678,7 +1678,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
 	if (!cp) {
 		int v;
 
-		if (!sysctl_schedule_icmp(ipvs))
+		if (ipip || !sysctl_schedule_icmp(ipvs))
 			return NF_ACCEPT;
 
 		if (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, &v, &cp, &ciph))
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 8 lines · Julian Anastasov

We can receive ICMP errors from client or from
tunneling real server. While the former can be
scheduled to real server, the latter should
not be scheduled, they are decapsulated only when
existing connection is found.

Fixes 6044eeffafbe ("ipvs: attempt to schedule icmp packets")

Thanks Julian, I assume this is also relevant to -stable.

Pablo, please consider applying this to nf.

Quoted 20 lines
---
 net/netfilter/ipvs/ip_vs_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_core.c +1 -1
index 43bbaa32b1d6..14457551bcb4 100644
@@ -1678,7 +1678,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
 	if (!cp) {
 		int v;
 
-		if (!sysctl_schedule_icmp(ipvs))
+		if (ipip || !sysctl_schedule_icmp(ipvs))
 			return NF_ACCEPT;
 
 		if (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, &v, &cp, &ciph))
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

Hello,

Quoted 11 lines · Simon Horman
Quoted 8 lines · Julian Anastasov

We can receive ICMP errors from client or from
tunneling real server. While the former can be
scheduled to real server, the latter should
not be scheduled, they are decapsulated only when
existing connection is found.

Fixes 6044eeffafbe ("ipvs: attempt to schedule icmp packets")

Thanks Julian, I assume this is also relevant to -stable.

Yes

Quoted 16 lines

Pablo, please consider applying this to nf.

Quoted 12 lines
---
 net/netfilter/ipvs/ip_vs_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_core.c +0 -0
index 43bbaa32b1d6..14457551bcb4 100644
@@ -1678,7 +1678,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
 	if (!cp) {
 		int v;
 
Quoted 7 lines
Quoted 7 lines
net/netfilter/ipvs/ip_vs_core.c +1 -1
-		if (!sysctl_schedule_icmp(ipvs))
+		if (ipip || !sysctl_schedule_icmp(ipvs))
 			return NF_ACCEPT;
 
 		if (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, &v, &cp, &ciph))
Signature · 1 line
2.17.1

Regards

--
Julian Anastasov <[email protected]>

maintainer Applied
#3 lore raw
In reply to Julian Anastasov
Quoted 5 lines · Julian Anastasov

We can receive ICMP errors from client or from tunneling real server. While the former can be scheduled to real server, the latter should not be scheduled, they are decapsulated only when existing connection is found.

Applied, thanks.