Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: conntrack: avoid excess memory allocation

This is now a fixed-size extension, so we don't need to pass a variable
alloc size. This (harmless) error results in allocating 32 instead of
the needed 16 bytes for this extension as the size gets passed twice.

Fixes: 23014011ba420 ("netfilter: conntrack: support a fixed size of 128 distinct labels")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Florian Westphal and committed by
Pablo Neira Ayuso
cdb436d1 f1d505bb

+1 -2
+1 -2
include/net/netfilter/nf_conntrack_labels.h
··· 30 30 if (net->ct.labels_used == 0) 31 31 return NULL; 32 32 33 - return nf_ct_ext_add_length(ct, NF_CT_EXT_LABELS, 34 - sizeof(struct nf_conn_labels), GFP_ATOMIC); 33 + return nf_ct_ext_add(ct, NF_CT_EXT_LABELS, GFP_ATOMIC); 35 34 #else 36 35 return NULL; 37 36 #endif