Unverified Commit 27fb9c3c authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14159 netfilter: nft_payload: sanitize offset and length before calling skb_checksum()

parents c61b557e 4cb3f5b8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -306,6 +306,9 @@ static void nft_payload_set_eval(const struct nft_expr *expr,
	if ((priv->csum_type == NFT_PAYLOAD_CSUM_INET || priv->csum_flags) &&
	    (priv->base != NFT_PAYLOAD_TRANSPORT_HEADER ||
	     skb->ip_summed != CHECKSUM_PARTIAL)) {
		if (offset + priv->len > skb->len)
			goto err;

		fsum = skb_checksum(skb, offset, priv->len, 0);
		tsum = csum_partial(src, priv->len, 0);