netfilter: nft_byteorder: length must be multiple of size
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/1 netfilter: nft_byteorder: length must be multiple of size
Although init path validates that store does not go over the register boundaries, the eval loop iterates over length / size to perform the byteorder swap.
Make sure length is a multiple of size, otherwise userspace is buggy.
Fixes 96518518cc41 ("netfilter: add nftables")
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- net/netfilter/nft_byteorder.c | 3 +++ 1 file changed, 3 insertions(+)
net/netfilter/nft_byteorder.c +3 -0
@@ -139,6 +139,9 @@ static int nft_byteorder_init(const struct nft_ctx *ctx, priv->len = len; +if (len % size !=0 ) +return -EINVAL ; + err =nft_parse_register_load (tb[NFTA_BYTEORDER_SREG ], &priv->sreg, priv->len);if (err <0 )
Signature · 1 line
2.30.2