netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org, mingi cho <mgcho.minic@gmail.com>
Subject: Re: [PATCH nf] netfilter: nf_tables: fix null deref due to zeroed list head
Date: Tue, 9 Aug 2022 23:39:03 +0200	[thread overview]
Message-ID: <YvLT94oa20O6TZL1@salvia> (raw)
In-Reply-To: <20220809163402.20227-1-fw@strlen.de>

On Tue, Aug 09, 2022 at 06:34:02PM +0200, Florian Westphal wrote:
> In nf_tables_updtable, if nf_tables_table_enable returns an error,
> nft_trans_destroy is called to free the transaction object.
> 
> nft_trans_destroy() calls list_del(), but the transaction was never
> placed on a list -- the list head is all zeroes, this results in
> a null dereference:
> 
> BUG: KASAN: null-ptr-deref in nft_trans_destroy+0x26/0x59
> Call Trace:
>  nft_trans_destroy+0x26/0x59
>  nf_tables_newtable+0x4bc/0x9bc
>  [..]
> 
> Its sane to assume that nft_trans_destroy() can be called
> on the transaction object returned by nft_trans_alloc(), so
> make sure the list head is initialised.

Applied to nf.git, thanks

      reply	other threads:[~2022-08-09 21:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09 16:34 [PATCH nf] netfilter: nf_tables: fix null deref due to zeroed list head Florian Westphal
2022-08-09 21:39 ` Pablo Neira Ayuso [this message]

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=YvLT94oa20O6TZL1@salvia \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=mgcho.minic@gmail.com \
    --cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).