Skip to contentSkip to conversation

nf_conntrack: fix memset() size.

NETFILTER Samir Bellabes 3 participants 5 messages Jan 25, 2006 1 message not in the archive

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

Hi,

This patch fix a bad size in memset().
The memory handle by 'struct nf_conntrack_helper ftp[MAX_PORTS][2]' is only set for ftp[*][0], but not for ftp[*][1].

please apply, thanks
sam

[NETFILTER] nf_conntrack: fix memset() size.

memset() don't set memory of the 'struct nf_conntrack_helper' at ftp[*][1]

---

 net/netfilter/nf_conntrack_ftp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

applies-to: 84cf4e20ce5038cb701373c6d9f97195dfd23dfc 34b60542dcfb5fbc2f37de6157cc31d35c6b66df

net/netfilter/nf_conntrack_ftp.c +1 -1
index ab0c920..e2c9f36 100644
@@ -657,7 +657,7 @@ static int __init init(void)
        /* FIXME should be configurable whether IPv4 and IPv6 FTP connections
                 are tracked or not - YK */
        for (i = 0; i < ports_c; i++) {
-               memset(&ftp[i], 0, sizeof(struct nf_conntrack_helper));
+               memset(&ftp[i], 0, 2*sizeof(struct nf_conntrack_helper));
                
                ftp[i][0].tuple.src.l3num = PF_INET;
                ftp[i][1].tuple.src.l3num = PF_INET6;
#1 lore raw

Hi,

From: Samir Bellabes <[email protected]>
Date: Wed, 25 Jan 2006 04:30:20 +0100

Quoted 6 lines

This patch fix a bad size in memset().
The memory handle by 'struct nf_conntrack_helper ftp[MAX_PORTS][2]' is only set for ftp[*][0], but not for ftp[*][1].

please apply, thanks
sam

Thanks. But I think better change is just removing this memset() because 'ftp' is declared in global area. Can I ask you to re-send a patch which just removes this memset() ?

-- Yasuyuki Kozakai

#2 lore raw
Quoted 8 lines · Yasuyuki KOZAKAI

From: Samir Bellabes <[email protected]>

Quoted 3 lines

This patch fix a bad size in memset().
The memory handle by 'struct nf_conntrack_helper ftp[MAX_PORTS][2]' is only set for ftp[*][0], but not for ftp[*][1].

Thanks. But I think better change is just removing this memset() because 'ftp' is declared in global area. Can I ask you to re-send a patch which just removes this memset() ?

[PATCH] [NETFILTER] nf_conntrack_ftp : delete bogus memset()

This memset() is executing with a bad size.
According to Yasuyuki Kozakai, this memset() can be deleted, as 'ftp' is declared in global area.

---

 net/netfilter/nf_conntrack_ftp.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

applies-to: 84cf4e20ce5038cb701373c6d9f97195dfd23dfc 2b9fb3186e686e0f1029c33d7a2aaa2dcf20b36f

net/netfilter/nf_conntrack_ftp.c +0 -2
index ab0c920..6f210f3 100644
@@ -657,8 +657,6 @@ static int __init init(void)
        /* FIXME should be configurable whether IPv4 and IPv6 FTP connections
                 are tracked or not - YK */
        for (i = 0; i < ports_c; i++) {
-               memset(&ftp[i], 0, sizeof(struct nf_conntrack_helper));
-
                ftp[i][0].tuple.src.l3num = PF_INET;
                ftp[i][1].tuple.src.l3num = PF_INET6;
                for (j = 0; j < 2; j++) {
#3 lore raw

From: Samir Bellabes <[email protected]>
Date: Wed, 25 Jan 2006 05:44:06 +0100

Quoted 7 lines

[PATCH] [NETFILTER] nf_conntrack_ftp : delete bogus memset()

This memset() is executing with a bad size.
According to Yasuyuki Kozakai, this memset() can be deleted, as 'ftp' is declared in global area.

Well, your mailer or something seems to replace tab with white spaces. OK, I've fixed up this to save more mails. Anyway, thanks a lot !

Harald, or Patrick, please apply this.

[PATCH] [NETFILTER] nf_conntrack_ftp : delete bogus memset()

This memset() is executing with a bad size.
According to Yasuyuki Kozakai, this memset() can be deleted, as 'ftp' is declared in global area.

---

net/netfilter/nf_conntrack_ftp.c +0 -2
index ab0c920..6f210f3 100644
@@ -657,8 +657,6 @@ static int __init init(void)
 	/* FIXME should be configurable whether IPv4 and IPv6 FTP connections
 		 are tracked or not - YK */
 	for (i = 0; i < ports_c; i++) {
-		memset(&ftp[i], 0, sizeof(struct nf_conntrack_helper));
-
 		ftp[i][0].tuple.src.l3num = PF_INET;
 		ftp[i][1].tuple.src.l3num = PF_INET6;
 		for (j = 0; j < 2; j++) {

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 10 lines · Yasuyuki KOZAKAI

From: Samir Bellabes <[email protected]>
Date: Wed, 25 Jan 2006 05:44:06 +0100

Quoted 6 lines

[PATCH] [NETFILTER] nf_conntrack_ftp : delete bogus memset()

This memset() is executing with a bad size.
According to Yasuyuki Kozakai, this memset() can be deleted, as 'ftp' is declared in global area.

Quoted 7 lines
Quoted 1 line

Well, your mailer or something seems to replace tab with white spaces. OK, I've fixed up this to save more mails. Anyway, thanks a lot !

Harald, or Patrick, please apply this.

Done, thanks.