]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: bitwise: fix reduce comparisons
authorJeremy Sowden <jeremy@azazel.net>
Sun, 27 Mar 2022 22:36:25 +0000 (23:36 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 29 Mar 2022 21:33:46 +0000 (23:33 +0200)
commit9990d13a7dccf5c23e9b00ed099638ef93433f66
tree28eae9229951fcc7d54edce9b416e0fdfc0b6502
parent3ff819d326357b1c02a2971cf9100d745bd2d53e
netfilter: bitwise: fix reduce comparisons

The `nft_bitwise_reduce` and `nft_bitwise_fast_reduce` functions should
compare the bitwise operation in `expr` with the tracked operation
associated with the destination register of `expr`.  However, instead of
being called on `expr` and `track->regs[priv->dreg].selector`,
`nft_expr_priv` is called on `expr` twice, so both reduce functions
return true even when the operations differ.

Fixes: 6ad8275c3339 ("netfilter: nft_bitwise: track register operations")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_bitwise.c