Netfilter fixes for net
Subsystems (3)
Pablo Neira Ayuso
maintainercover Netfilter fixes for net
Hi,
The following patchset contains Netfilter fixes for net:
1) nft_parse_register_load() gets an incorrect datatype size as input, from Jeremy Sowden.
2) incorrect maximum netlink attribute in nft_redir, also from Jeremy.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit 37d9df224d1eec1b434fe9ffa40104c756478c29:
ynl: re-license uniformly under GPL-2.0 OR BSD-3-Clause (2023-03-07 13:44:30 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git HEAD
for you to fetch changes up to 493924519b1fe3faab13ee621a43b0d0939abab1:
netfilter: nft_redir: correct value of inet type .maxattrs (2023-03-08 12:26:42 +0100)
----------------------------------------------------------------
Jeremy Sowden (4):
netfilter: nft_nat: correct length for loading protocol registers
netfilter: nft_masq: correct length for loading protocol registers
netfilter: nft_redir: correct length for loading protocol registers
netfilter: nft_redir: correct value of inet type .maxattrs
net/netfilter/nft_masq.c | 2 +- net/netfilter/nft_nat.c | 2 +- net/netfilter/nft_redir.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
Pablo Neira Ayuso
maintainerPATCH 1/4 netfilter: nft_nat: correct length for loading protocol registers
From: Jeremy Sowden <[email protected]>
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.
--- net/netfilter/nft_nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_nat.c +1 -1
@@ -226,7 +226,7 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr, priv->flags |=NF_NAT_RANGE_MAP_IPS ; } - plen = sizeof_field(struct nf_nat_range, min_addr.all); + plen = sizeof_field(struct nf_nat_range, min_proto.all);if (tb[NFTA_NAT_REG_PROTO_MIN ]) { err =nft_parse_register_load (tb[NFTA_NAT_REG_PROTO_MIN ], &priv->sreg_proto_min, plen);
Signature · 1 line
2.30.2
Re: [PATCH net 1/4] netfilter: nft_nat: correct length for loading protocol registers
This series was applied to netdev/net.git (main) by Pablo Neira Ayuso <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Pablo Neira Ayuso <[email protected]>:
Quoted 8 lines · On Thu, 9 Mar 2023 18:46:52 +0100 you wrote:
From: Jeremy Sowden <[email protected]>
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 aunion nf_conntrack_man_protoinstead.[...]
Here is the summary with links:
- [net,1/4] netfilter: nft_nat: correct length for loading protocol registers
https://git.kernel.org/netdev/net/c/068d82e75d53 - [net,2/4] netfilter: nft_masq: correct length for loading protocol registers https://git.kernel.org/netdev/net/c/ec2c5917eb85 - [net,3/4] netfilter: nft_redir: correct length for loading protocol registers https://git.kernel.org/netdev/net/c/1f617b6b4c7a - [net,4/4] netfilter: nft_redir: correct value of inet type `.maxattrs` https://git.kernel.org/netdev/net/c/493924519b1f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Pablo Neira Ayuso
maintainerPATCH 2/4 netfilter: nft_masq: correct length for loading protocol registers
In reply to Pablo Neira AyusoFrom: Jeremy Sowden <[email protected]>
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.
--- net/netfilter/nft_masq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_masq.c +1 -1
@@ -43,7 +43,7 @@ static int nft_masq_init(const struct nft_ctx *ctx,const struct nft_expr *expr, const struct nlattr * const tb[]) { - u32 plen = sizeof_field(struct nf_nat_range, min_addr.all); + u32 plen = sizeof_field(struct nf_nat_range, min_proto.all);struct nft_masq *priv =nft_expr_priv (expr);int err;
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 3/4 netfilter: nft_redir: correct length for loading protocol registers
In reply to Pablo Neira AyusoFrom: Jeremy Sowden <[email protected]>
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.
--- net/netfilter/nft_redir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_redir.c +1 -1
@@ -48,7 +48,7 @@ static int nft_redir_init(const struct nft_ctx *ctx,unsigned int plen;int err; - plen = sizeof_field(struct nf_nat_range, min_addr.all); + plen = sizeof_field(struct nf_nat_range, min_proto.all);if (tb[NFTA_REDIR_REG_PROTO_MIN ]) { err =nft_parse_register_load (tb[NFTA_REDIR_REG_PROTO_MIN ], &priv->sreg_proto_min, plen);
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 4/4 netfilter: nft_redir: correct value of inet type `.maxattrs`
In reply to Pablo Neira AyusoFrom: Jeremy Sowden <[email protected]>
nft_redir_inet_type.maxattrs was being set, presumably because of a cut-and-paste error, to NFTA_MASQ_MAX, instead of NFTA_REDIR_MAX.
--- net/netfilter/nft_redir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_redir.c +1 -1
@@ -236,7 +236,7 @@ static struct nft_expr_type nft_redir_inet_type __read_mostly = { .name = "redir", .ops = &nft_redir_inet_ops, .policy = nft_redir_policy, - .maxattr = NFTA_MASQ_MAX, + .maxattr = NFTA_REDIR_MAX, .owner = THIS_MODULE, };
Signature · 1 line
2.30.2
Quoted 11 lines · Pablo Neira Ayuso
The following patchset contains Netfilter fixes for net:
1)
nft_parse_register_load()gets an incorrect datatype size as input, from Jeremy Sowden.2) incorrect maximum netlink attribute in
nft_redir, also from Jeremy.Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
Have you actually pushed these changes to nf.git? Can't see them. :)
J.
Pablo Neira Ayuso
maintainerQuoted 6 lines · Jeremy Sowden
Quoted 5 lines · Pablo Neira Ayuso
The following patchset contains Netfilter fixes for net:
1)
nft_parse_register_load()gets an incorrect datatype size as input, from Jeremy Sowden.
Quoted 8 lines
Quoted 6 lines
2) incorrect maximum netlink attribute in
nft_redir, also from Jeremy.Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.gitHave you actually pushed these changes to nf.git? Can't see them. :)
Oh, I pushed out to master, not main...