From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, audit@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nf_tables: Unbreak audit log reset
Date: Wed, 6 Sep 2023 13:32:50 +0200 [thread overview]
Message-ID: <ZPhjYkRpUvfqPB9F@orbyte.nwl.cc> (raw)
In-Reply-To: <20230906094202.1712-1-pablo@netfilter.org>
On Wed, Sep 06, 2023 at 11:42:02AM +0200, Pablo Neira Ayuso wrote:
> Deliver audit log from __nf_tables_dump_rules(), table dereference at
> the end of the table list loop might point to the list head, leading to
> this crash.
Ah, of course. Sorry for the mess. I missed the fact that one may just
call 'reset rules' and have it apply to all existing tables.
[...]
> Deliver audit log only once at the end of the rule dump+reset for
> consistency with the set dump+reset.
This may seem like number of audit logs is reduced, when it is actually
increased: With your patch, there will be at least one notification for
each chain, multiple with large chains (due to skb exhaustion). Not
necessarily a problem, but worth mentioning. Also, I wonder if one
should go the extra mile and add the chain name to log entries. I had
considered to pass a string like "mytable:123 chain=mychain" to
audit_log_nfcfg() for that matter, but it's quite a hack.
> Ensure audit reset access to table under rcu read side lock. The table
> list iteration holds rcu read lock side, but recent audit code
> dereferences table object out of the rcu read lock side.
>
> Fixes: ea078ae9108e ("netfilter: nf_tables: Audit log rule reset")
> Fixes: 7e9be1124dbe ("netfilter: nf_tables: Audit log setelem reset")
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Phil Sutter <phil@nwl.cc>
next parent reply other threads:[~2023-09-06 11:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230906094202.1712-1-pablo@netfilter.org>
2023-09-06 11:32 ` Phil Sutter [this message]
2023-09-06 11:47 ` [PATCH nf] netfilter: nf_tables: Unbreak audit log reset Pablo Neira Ayuso
2023-09-06 17:08 ` Phil Sutter
2023-09-06 18:46 ` Pablo Neira Ayuso
2023-09-06 19:56 ` Paul Moore
2023-09-06 21:39 ` Phil Sutter
2023-09-06 22:21 ` Pablo Neira Ayuso
2023-09-06 22:41 ` Paul Moore
2023-09-06 23:01 ` Pablo Neira Ayuso
2023-09-06 23:25 ` Paul Moore
2023-09-06 22:36 ` Paul Moore
2023-09-06 18:20 ` Richard Guy Briggs
2023-09-06 18:22 ` Richard Guy Briggs
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=ZPhjYkRpUvfqPB9F@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=audit@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox