Skip to contentSkip to conversation

nf_tables: fix bogus warning in nft_data_uninit()

PATCH In review Pablo Neira Ayuso 1 participant 2 messages May 15, 2015

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 nf_tables: fix bogus warning in nft_data_uninit()

From: Pablo Neira Ayuso <[email protected]>

From: Mirek Kratochvil <[email protected]>

The values 0x00000000-0xfffffeff are reserved for userspace datatype. When, deleting set elements with maps, a bogus warning is triggered.

WARNING: CPU: 0 PID: 11133 at net/netfilter/nf_tables_api.c:4481 nft_data_uninit+0x35/0x40 [nf_tables]()

This fixes the check accordingly to enum definition in include/linux/netfilter/nf_tables.h

Based on patch from Mirek.

---
I'm sending a v2 of this patch:

http://patchwork.ozlabs.org/patch/465960/

It doesn't apply cleanly to the nf tree and I have adjusted the indentation. If no objections, I'll apply this to the nf tree. Thanks.

 net/netfilter/nf_tables_api.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_tables_api.c +2 -2
index ad9d11f..34ded09 100644
@@ -4472,9 +4472,9 @@ EXPORT_SYMBOL_GPL(nft_data_init);
  */
 void nft_data_uninit(const struct nft_data *data, enum nft_data_types type)
 {
-	switch (type) {
-	case NFT_DATA_VALUE:
+	if (type < NFT_DATA_VERDICT)
 		return;
+	switch (type) {
 	case NFT_DATA_VERDICT:
 		return nft_verdict_uninit(data);
 	default:
Signature · 1 line
1.7.10.4
author maintainer
#1 lore raw
Quoted 3 lines · Pablo Neira Ayuso

From: Pablo Neira Ayuso <[email protected]>

From: Mirek Kratochvil <[email protected]>

Just for the record: I'll mangle this to restore your original authorship before applying, that was my intention.

Quoted 7 lines

The values 0x00000000-0xfffffeff are reserved for userspace datatype. When, deleting set elements with maps, a bogus warning is triggered.

WARNING: CPU: 0 PID: 11133 at net/netfilter/nf_tables_api.c:4481 nft_data_uninit+0x35/0x40 [nf_tables]()

This fixes the check accordingly to enum definition in include/linux/netfilter/nf_tables.h