Sfoglia il codice sorgente

[NETFILTER]: Check policy length in policy match strict mode

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy 19 anni fa
parent
commit
e55f1bc5dc
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1 1
      net/ipv4/netfilter/ipt_policy.c
  2. 1 1
      net/ipv6/netfilter/ip6t_policy.c

+ 1 - 1
net/ipv4/netfilter/ipt_policy.c

@@ -89,7 +89,7 @@ match_policy_out(const struct sk_buff *skb, const struct ipt_policy_info *info)
 			return 0;
 	}
 
-	return strict ? 1 : 0;
+	return strict ? i == info->len : 0;
 }
 
 static int match(const struct sk_buff *skb,

+ 1 - 1
net/ipv6/netfilter/ip6t_policy.c

@@ -91,7 +91,7 @@ match_policy_out(const struct sk_buff *skb, const struct ip6t_policy_info *info)
 			return 0;
 	}
 
-	return strict ? 1 : 0;
+	return strict ? i == info->len : 0;
 }
 
 static int match(const struct sk_buff *skb,