]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: nft_redir: correct length for loading protocol registers
authorJeremy Sowden <jeremy@azazel.net>
Tue, 7 Mar 2023 23:22:58 +0000 (23:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:29:56 +0000 (13:29 +0100)
commitc144dff64ea9c924c1a85714d4fcf420c2df3213
tree5cf90365931a280e56dd4f2b24471e3e1329ed2b
parent3a0f8ea35ddc9b205dbc04f6e848890ec983065e
netfilter: nft_redir: correct length for loading protocol registers

[ Upstream commit 1f617b6b4c7a3d5ea7a56abb83a4c27733b60c2f ]

The values in the protocol registers are two bytes wide.  However, when
parsing the register loads, the code currently uses the larger 16-byte
size of a `union nf_inet_addr`.  Change it to use the (correct) size of
a `union nf_conntrack_man_proto` instead.

Fixes: d07db9884a5f ("netfilter: nf_tables: introduce nft_validate_register_load()")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_redir.c