]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: nf_tables: fix nft_trans type confusion
authorFlorian Westphal <fw@strlen.de>
Thu, 11 May 2023 12:15:15 +0000 (14:15 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 17 May 2023 12:16:02 +0000 (14:16 +0200)
commite3c361b8acd636f5fe80c02849ca175201edf10c
tree2414d2eac0572f7efb5ba3a44d5d42387bf63e0a
parent224a876e37543eee111bf9b6aa4935080e619335
netfilter: nf_tables: fix nft_trans type confusion

nft_trans_FOO objects all share a common nft_trans base structure, but
trailing fields depend on the real object size. Access is only safe after
trans->msg_type check.

Check for rule type first.  Found by code inspection.

Fixes: 1a94e38d254b ("netfilter: nf_tables: add NFTA_RULE_ID attribute")
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nf_tables_api.c