mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
netfilter: nft_byteorder: track register operations
Cancel tracking for byteorder operation, otherwise selector + byteorder operation is incorrectly reduced if source and destination registers are the same. Reported-by: kernel test robot <oliver.sang@intel.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
aeac4554eb
commit
f459bfd4b9
@ -167,12 +167,24 @@ nla_put_failure:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool nft_byteorder_reduce(struct nft_regs_track *track,
|
||||||
|
const struct nft_expr *expr)
|
||||||
|
{
|
||||||
|
struct nft_byteorder *priv = nft_expr_priv(expr);
|
||||||
|
|
||||||
|
track->regs[priv->dreg].selector = NULL;
|
||||||
|
track->regs[priv->dreg].bitwise = NULL;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct nft_expr_ops nft_byteorder_ops = {
|
static const struct nft_expr_ops nft_byteorder_ops = {
|
||||||
.type = &nft_byteorder_type,
|
.type = &nft_byteorder_type,
|
||||||
.size = NFT_EXPR_SIZE(sizeof(struct nft_byteorder)),
|
.size = NFT_EXPR_SIZE(sizeof(struct nft_byteorder)),
|
||||||
.eval = nft_byteorder_eval,
|
.eval = nft_byteorder_eval,
|
||||||
.init = nft_byteorder_init,
|
.init = nft_byteorder_init,
|
||||||
.dump = nft_byteorder_dump,
|
.dump = nft_byteorder_dump,
|
||||||
|
.reduce = nft_byteorder_reduce,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nft_expr_type nft_byteorder_type __read_mostly = {
|
struct nft_expr_type nft_byteorder_type __read_mostly = {
|
||||||
|
Loading…
Reference in New Issue
Block a user