]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: fix crash when nf_trace is enabled
authorFlorian Westphal <fw@strlen.de>
Thu, 4 Aug 2022 17:26:27 +0000 (19:26 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Aug 2022 01:50:14 +0000 (18:50 -0700)
commit4c26c34dda5cbfe16921e72207c2fab5b2c301b1
tree5dc2ddb6abb182b1ee7fc14458ddf3387f7d6fbf
parent756cce3d00d37aa0dfb7e1ba8b1aca6627068551
netfilter: nf_tables: fix crash when nf_trace is enabled

do not access info->pkt when info->trace is not 1.
nft_traceinfo is not initialized, except when tracing is enabled.

The 'nft_trace_enabled' static key cannot be used for this, we must
always check info->trace first.

Pass nft_pktinfo directly to avoid this.

Fixes: 7a71b8c6e1bb ("netfilter: nf_tables: avoid skb access on nf_stolen")
Reported-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/netfilter/nf_tables_core.c