Skip to content

Commit

Permalink
netfilter: nft_bitwise: fix register tracking
Browse files Browse the repository at this point in the history
[ Upstream commit 14e8b29 ]

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: 34cc9e5 ("netfilter: nf_tables: cancel tracking for clobbered destination registers")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
a3a3el authored and gregkh committed Jun 14, 2023
1 parent a1f6b02 commit 2431f65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nft_bitwise.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static bool nft_bitwise_reduce(struct nft_regs_track *track,
dreg = priv->dreg;
regcount = DIV_ROUND_UP(priv->len, NFT_REG32_SIZE);
for (i = 0; i < regcount; i++, dreg++)
track->regs[priv->dreg].bitwise = expr;
track->regs[dreg].bitwise = expr;

return false;
}
Expand Down

0 comments on commit 2431f65

Please sign in to comment.