diff mbox

[nf] nf_tables: fix bogus warning in nft_data_uninit()

Message ID 1431720355-3604-1-git-send-email-pablo@netfilter.org
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Pablo Neira Ayuso May 15, 2015, 8:05 p.m. UTC
From: Pablo Neira Ayuso <pablo@netfilter.orgi>

From: Mirek Kratochvil <exa.exa@gmail.com>

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.

Fixes: https://bugzilla.netfilter.org/show_bug.cgi?id=1013
Reported-by: Mirek Kratochvil <exa.exa@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
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(-)

Comments

Pablo Neira Ayuso May 15, 2015, 8:08 p.m. UTC | #1
On Fri, May 15, 2015 at 10:05:55PM +0200, Pablo Neira Ayuso wrote:
> From: Pablo Neira Ayuso <pablo@netfilter.orgi>
> 
> From: Mirek Kratochvil <exa.exa@gmail.com>

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

> 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
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index ad9d11f..34ded09 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -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: