]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: nf_tables: do not store rule in traceinfo structure
authorFlorian Westphal <fw@strlen.de>
Fri, 14 Apr 2023 13:01:34 +0000 (15:01 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 21 Apr 2023 23:39:41 +0000 (01:39 +0200)
commit46df417544f4f7fa3438caada0dc0e534a694343
tree6aa9437d46fea9f622e4736dbd8aa67e21fa22d8
parent0a202145d5f9277dd24474aca8245731d030f29e
netfilter: nf_tables: do not store rule in traceinfo structure

pass it as argument instead.  This reduces size of traceinfo to
16 bytes.  Total stack usage:

 nf_tables_core.c:252 nft_do_chain    304     static

While its possible to also pass basechain as argument, doing so
increases nft_do_chaininfo function size.

Unlike pktinfo/verdict/rule the basechain info isn't used in
the expression evaluation path. gcc places it on the stack, which
results in extra push/pop when it gets passed to the trace helpers
as argument rather than as part of the traceinfo structure.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_core.c
net/netfilter/nf_tables_trace.c