All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nftables] evaluate: don't crash on set definition with incorrect datatype
Date: Mon, 10 May 2021 18:55:00 +0200	[thread overview]
Message-ID: <20210510165500.147706-1-pablo@netfilter.org> (raw)

Cache updates have resurrected the bug described in 5afa5a164ff1
("evaluate: check for NULL datatype in rhs in lookup expr").

This is triggered by testcases/cache/0008_delete_by_handle_0.

Fixes: df48e56e987f ("cache: add hashtable cache for sets")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/evaluate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/evaluate.c b/src/evaluate.c
index e91d5236564e..75983b3c7a6a 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -262,7 +262,7 @@ static int expr_evaluate_symbol(struct eval_ctx *ctx, struct expr **expr)
 			return table_not_found(ctx);
 
 		set = set_cache_find(table, (*expr)->identifier);
-		if (set == NULL)
+		if (set == NULL || !set->key)
 			return set_not_found(ctx, &(*expr)->location,
 					     (*expr)->identifier);
 
-- 
2.30.2


                 reply	other threads:[~2021-05-10 16:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210510165500.147706-1-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --subject='Re: [PATCH nftables] evaluate: don'\''t crash on set definition with incorrect datatype' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.