Only boolean operations supports offloading, so check the type of the operation and return an error for other types. Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx> --- net/netfilter/nft_bitwise.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/netfilter/nft_bitwise.c b/net/netfilter/nft_bitwise.c index 40272a45deeb..1d9079ba2102 100644 --- a/net/netfilter/nft_bitwise.c +++ b/net/netfilter/nft_bitwise.c @@ -190,6 +190,9 @@ static int nft_bitwise_offload(struct nft_offload_ctx *ctx, priv->sreg != priv->dreg || priv->len != reg->len) return -EOPNOTSUPP; + if (priv->op != NFT_BITWISE_BOOL) + return -EOPNOTSUPP; + memcpy(®->mask, &priv->mask, sizeof(priv->mask)); return 0; -- 2.24.1