Skip to content

Commit fa487d6

Browse files
committed
netfilter: nft_redir: correct length for loading protocol registers
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2189550 Upstream Status: commit 1f617b6 commit 1f617b6 Author: Jeremy Sowden <jeremy@azazel.net> Date: Tue Mar 7 23:22:58 2023 +0000 netfilter: nft_redir: correct length for loading protocol registers 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: d07db98 ("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: Florian Westphal <fwestpha@redhat.com>
1 parent ccbff46 commit fa487d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nft_redir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static int nft_redir_init(const struct nft_ctx *ctx,
4848
unsigned int plen;
4949
int err;
5050

51-
plen = sizeof_field(struct nf_nat_range, min_addr.all);
51+
plen = sizeof_field(struct nf_nat_range, min_proto.all);
5252
if (tb[NFTA_REDIR_REG_PROTO_MIN]) {
5353
err = nft_parse_register_load(tb[NFTA_REDIR_REG_PROTO_MIN],
5454
&priv->sreg_proto_min, plen);

0 commit comments

Comments
 (0)