All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Anton Moryakov <ant.v.moryakov@gmail.com>
Cc: netfilter-devel@vger.kernel.org, pablo@netfilter.org
Subject: Re: [PATCH] rule: fix NULL pointer dereference in do_list_flowtable
Date: Thu, 5 Mar 2026 15:04:52 +0100	[thread overview]
Message-ID: <aamNhIWHDeGQOXaf@strlen.de> (raw)
In-Reply-To: <20260302160539.248755-1-ant.v.moryakov@gmail.com>

Anton Moryakov <ant.v.moryakov@gmail.com> wrote:
> Static analysis found a potential NULL pointer dereference in
> do_command_list() when handling CMD_OBJ_FLOWTABLE.
> 
> If cmd->handle.table.name is not specified, the table pointer remains
> NULL after the cache lookup block. However, do_list_flowtable() expects
> a valid table pointer and dereferences it via ft_cache_find().

Not following, table is never NULL in the function:

static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd)
{
	struct table *table = NULL; [..]

	if (cmd->handle.table.name != NULL) {
		table = table_cache_find(&ctx->nft->cache.table_cache,
					 cmd->handle.table.name,
					 cmd->handle.family);
		if (!table) {
			errno = ENOENT;
			return -1;
		}
	}

	switch (cmd->obj) {
[..]
	case CMD_OBJ_FLOWTABLE:
		return do_list_flowtable(ctx, cmd, table);

This has been the case for almost a year:

commit 853d3a2d3cbdc7aab16d3d33999d00b32a6db7ce
Date:   Thu Mar 20 14:31:42 2025 +0100
rule: return error if table does not exist


  reply	other threads:[~2026-03-05 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 16:05 [PATCH] rule: fix NULL pointer dereference in do_list_flowtable Anton Moryakov
2026-03-05 14:04 ` Florian Westphal [this message]
2026-03-05 16:55   ` Pablo Neira Ayuso

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=aamNhIWHDeGQOXaf@strlen.de \
    --to=fw@strlen.de \
    --cc=ant.v.moryakov@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.