Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1590361 > unrolled thread

[PATCH] netfilter: nf_conntrack_sip: fix wrong memory initialisation

Started byChristophe Leroy <christophe.leroy@c-s.fr>
First post2017-03-01 15:40 +0100
Last post2017-03-03 14:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] netfilter: nf_conntrack_sip: fix wrong memory initialisation Christophe Leroy <christophe.leroy@c-s.fr> - 2017-03-01 15:40 +0100
    Re: [PATCH] netfilter: nf_conntrack_sip: fix wrong memory  initialisation Pablo Neira Ayuso <pablo@netfilter.org> - 2017-03-03 14:10 +0100

#1590361 — [PATCH] netfilter: nf_conntrack_sip: fix wrong memory initialisation

FromChristophe Leroy <christophe.leroy@c-s.fr>
Date2017-03-01 15:40 +0100
Subject[PATCH] netfilter: nf_conntrack_sip: fix wrong memory initialisation
Message-ID<tgdA6-4nt-9@gated-at.bofh.it>
In commit 82de0be6862cd ("netfilter: Add helper array
register/unregister functions"),
struct nf_conntrack_helper sip[MAX_PORTS][4] was changed to
sip[MAX_PORTS * 4], so the memory init should have been changed to
memset(&sip[4 * i], 0, 4 * sizeof(sip[i]));

But as the sip[] table is allocated in the BSS, it is already set to 0

Fixes: 82de0be6862cd ("netfilter: Add helper array
register/unregister functions")
Cc: stable@vger.kernel.org

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 net/netfilter/nf_conntrack_sip.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 24174c520239..0d17894798b5 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -1628,8 +1628,6 @@ static int __init nf_conntrack_sip_init(void)
 		ports[ports_c++] = SIP_PORT;
 
 	for (i = 0; i < ports_c; i++) {
-		memset(&sip[i], 0, sizeof(sip[i]));
-
 		nf_ct_helper_init(&sip[4 * i], AF_INET, IPPROTO_UDP, "sip",
 				  SIP_PORT, ports[i], i, sip_exp_policy,
 				  SIP_EXPECT_MAX,
-- 
2.12.0

[toc] | [next] | [standalone]


#1591926 — Re: [PATCH] netfilter: nf_conntrack_sip: fix wrong memory initialisation

FromPablo Neira Ayuso <pablo@netfilter.org>
Date2017-03-03 14:10 +0100
SubjectRe: [PATCH] netfilter: nf_conntrack_sip: fix wrong memory initialisation
Message-ID<tgV85-1Hn-1@gated-at.bofh.it>
In reply to#1590361
On Wed, Mar 01, 2017 at 03:33:26PM +0100, Christophe Leroy wrote:
> In commit 82de0be6862cd ("netfilter: Add helper array
> register/unregister functions"),
> struct nf_conntrack_helper sip[MAX_PORTS][4] was changed to
> sip[MAX_PORTS * 4], so the memory init should have been changed to
> memset(&sip[4 * i], 0, 4 * sizeof(sip[i]));
> 
> But as the sip[] table is allocated in the BSS, it is already set to 0

Applied, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web