Skip to contentSkip to conversation

: nf_nat: fix memset error

NETFILTER -stable Patrick McHardy 2 participants 3 messages Nov 28, 2007 – Dec 12, 2007

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

This patch fixes an incorrect memset in the NAT code, causing misbehaviour when unloading and reloading the NAT module. Applies to stable-2.6.22 and stable-2.6.23.

Please apply, thanks.

[NETFILTER]: nf_nat: fix memset error

Upstream commit e0bf9cf15fc30d300b7fbd821c6bc975531fab44

The size passing to memset is the size of a pointer. Fixes misbehaviour when unloading and reloading the NAT module.

---
commit 5811c2a0705a77524b2b12d927e874d2fa6520b3
tree e71651d274c89fea540c87b98b990db2e4cafe5b
parent 8996d0af900ec60b8b59435aa231e2d449bba6af
author Li Zefan <[email protected]> Wed, 28 Nov 2007 09:24:42 +0100 committer Patrick McHardy <[email protected]> Wed, 28 Nov 2007 09:24:42 +0100

 net/ipv4/netfilter/nf_nat_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/netfilter/nf_nat_core.c +1 -1
index deab27f..553ebb8 100644
@@ -681,7 +681,7 @@ static int clean_nat(struct nf_conn *i, void *data)
 
 	if (!nat)
 		return 0;
-	memset(nat, 0, sizeof(nat));
+	memset(nat, 0, sizeof(*nat));
 	i->status &= ~(IPS_NAT_MASK | IPS_NAT_DONE_MASK | IPS_SEQ_ADJUST);
 	return 0;
 }
#1 lore raw

patch nf_nat-fix-memset-error.patch queued to -stable tree

This is a note to let you know that we have just queued up the patch titled

Subject: nf_nat: fix memset error

to the 2.6.23-stable tree. Its filename is

nf_nat-fix-memset-error.patch

A git repo of this tree can be found at
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 1 line

From [email protected] Wed Nov 28 00:56:55 2007

From: Li Zefan <[email protected]>
Date: Wed, 28 Nov 2007 09:56:27 +0100
Subject: nf_nat: fix memset error
To: [email protected]
Cc: Netfilter Development Mailinglist <[email protected]>, "David S. Miller" <[email protected]>
Message-ID: <[email protected]>

From: Li Zefan <[email protected]>

This patch fixes an incorrect memset in the NAT code, causing misbehaviour when unloading and reloading the NAT module. Applies to stable-2.6.22 and stable-2.6.23.

Please apply, thanks.
[NETFILTER]: nf_nat: fix memset error

Upstream commit e0bf9cf15fc30d300b7fbd821c6bc975531fab44

The size passing to memset is the size of a pointer. Fixes misbehaviour when unloading and reloading the NAT module.

---
 net/ipv4/netfilter/nf_nat_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/netfilter/nf_nat_core.c +1 -1
@@ -681,7 +681,7 @@ static int clean_nat(struct nf_conn *i, 
 
 	if (!nat)
 		return 0;
-	memset(nat, 0, sizeof(nat));
+	memset(nat, 0, sizeof(*nat));
 	i->status &= ~(IPS_NAT_MASK | IPS_NAT_DONE_MASK | IPS_SEQ_ADJUST);
 	return 0;
 }

Patches currently in stable-queue which might be from [email protected] are

queue-2.6.23/nf_nat-fix-memset-error.patch

#2 lore raw

patch nf_nat-fix-memset-error.patch queued to -stable tree

In reply to Patrick McHardy

This is a note to let you know that we have just queued up the patch titled

Subject: nf_nat: fix memset error

to the 2.6.22-stable tree. Its filename is

nf_nat-fix-memset-error.patch

A git repo of this tree can be found at
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 1 line

From [email protected] Wed Nov 28 00:56:55 2007

From: Li Zefan <[email protected]>
Date: Wed, 28 Nov 2007 09:56:27 +0100
Subject: nf_nat: fix memset error
To: [email protected]
Cc: Netfilter Development Mailinglist <[email protected]>, "David S. Miller" <[email protected]>
Message-ID: <[email protected]>

From: Li Zefan <[email protected]>

This patch fixes an incorrect memset in the NAT code, causing misbehaviour when unloading and reloading the NAT module. Applies to stable-2.6.22 and stable-2.6.23.

Please apply, thanks.
[NETFILTER]: nf_nat: fix memset error

Upstream commit e0bf9cf15fc30d300b7fbd821c6bc975531fab44

The size passing to memset is the size of a pointer. Fixes misbehaviour when unloading and reloading the NAT module.

---
 net/ipv4/netfilter/nf_nat_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/netfilter/nf_nat_core.c +1 -1
@@ -633,7 +633,7 @@ static int clean_nat(struct nf_conn *i, 
 
 	if (!nat)
 		return 0;
-	memset(nat, 0, sizeof(nat));
+	memset(nat, 0, sizeof(*nat));
 	i->status &= ~(IPS_NAT_MASK | IPS_NAT_DONE_MASK | IPS_SEQ_ADJUST);
 	return 0;
 }

Patches currently in stable-queue which might be from [email protected] are

queue-2.6.22/nf_nat-fix-memset-error.patch