aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter/ip_nat_proto_udp.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2005-07-22 12:50:29 -0700
committerDavid S. Miller <davem@davemloft.net>2005-07-22 12:50:29 -0700
commitd04b4f8c1c9766e49fad6a141fc61cb30db69a5c (patch)
tree4355aafff80fc9a09597d4990a45b51b30359cf3 /net/ipv4/netfilter/ip_nat_proto_udp.c
parent[NETFILTER]: Fix deadlock in ip6_queue (diff)
downloadlinux-dev-d04b4f8c1c9766e49fad6a141fc61cb30db69a5c.tar.xz
linux-dev-d04b4f8c1c9766e49fad6a141fc61cb30db69a5c.zip
[NETFILTER]: Fix potential memory corruption in NAT code (aka memory NAT)
The portptr pointing to the port in the conntrack tuple is declared static, which could result in memory corruption when two packets of the same protocol are NATed at the same time and one conntrack goes away. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv4/netfilter/ip_nat_proto_udp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/netfilter/ip_nat_proto_udp.c b/net/ipv4/netfilter/ip_nat_proto_udp.c
index c669e3b5f5d0..9f66e5625664 100644
--- a/net/ipv4/netfilter/ip_nat_proto_udp.c
+++ b/net/ipv4/netfilter/ip_nat_proto_udp.c
@@ -41,7 +41,8 @@ udp_unique_tuple(struct ip_conntrack_tuple *tuple,
enum ip_nat_manip_type maniptype,
const struct ip_conntrack *conntrack)
{
- static u_int16_t port, *portptr;
+ static u_int16_t port;
+ u_int16_t *portptr;
unsigned int range_size, min, i;
if (maniptype == IP_NAT_MANIP_SRC)