* [NETFILTER 2/5]: Fix potential memory corruption in NAT code (aka memory NAT)
@ 2005-07-22 7:35 Patrick McHardy
2005-07-22 7:47 ` KOVACS Krisztian
2005-07-22 19:50 ` David S. Miller
0 siblings, 2 replies; 4+ messages in thread
From: Patrick McHardy @ 2005-07-22 7:35 UTC (permalink / raw)
To: David S. Miller; +Cc: Netfilter Development Mailinglist, stable
[-- Attachment #1: 02.diff --]
[-- Type: text/x-patch, Size: 1737 bytes --]
[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>
---
commit ca30527af14847bab487c91df56f99df3c7ad1b2
tree 5cc239c38671adf873d4ce219bd507738cdd2757
parent bbdfd0b519cf535692a25adc5aa7cab3079220b4
author Patrick McHardy <kaber@trash.net> Fri, 22 Jul 2005 09:22:33 +0200
committer Patrick McHardy <kaber@trash.net> Fri, 22 Jul 2005 09:22:33 +0200
net/ipv4/netfilter/ip_nat_proto_tcp.c | 3 ++-
net/ipv4/netfilter/ip_nat_proto_udp.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/netfilter/ip_nat_proto_tcp.c b/net/ipv4/netfilter/ip_nat_proto_tcp.c
--- a/net/ipv4/netfilter/ip_nat_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_nat_proto_tcp.c
@@ -40,7 +40,8 @@ tcp_unique_tuple(struct ip_conntrack_tup
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)
diff --git a/net/ipv4/netfilter/ip_nat_proto_udp.c b/net/ipv4/netfilter/ip_nat_proto_udp.c
--- 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_tup
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)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-07-22 19:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-22 7:35 [NETFILTER 2/5]: Fix potential memory corruption in NAT code (aka memory NAT) Patrick McHardy
2005-07-22 7:47 ` KOVACS Krisztian
2005-07-22 8:09 ` Patrick McHardy
2005-07-22 19:50 ` David S. Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.