Commit 14e8b293 authored by Jeremy Sowden's avatar Jeremy Sowden Committed by Pablo Neira Ayuso

netfilter: nft_bitwise: fix register tracking

At the end of `nft_bitwise_reduce`, there is a loop which is intended to
update the bitwise expression associated with each tracked destination
register.  However, currently, it just updates the first register
repeatedly.  Fix it.

Fixes: 34cc9e52 ("netfilter: nf_tables: cancel tracking for clobbered destination registers")
Signed-off-by: default avatarJeremy Sowden <jeremy@azazel.net>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent bd058763
...@@ -323,7 +323,7 @@ static bool nft_bitwise_reduce(struct nft_regs_track *track, ...@@ -323,7 +323,7 @@ static bool nft_bitwise_reduce(struct nft_regs_track *track,
dreg = priv->dreg; dreg = priv->dreg;
regcount = DIV_ROUND_UP(priv->len, NFT_REG32_SIZE); regcount = DIV_ROUND_UP(priv->len, NFT_REG32_SIZE);
for (i = 0; i < regcount; i++, dreg++) for (i = 0; i < regcount; i++, dreg++)
track->regs[priv->dreg].bitwise = expr; track->regs[dreg].bitwise = expr;
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment