From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F77445EB6 for ; Tue, 17 Dec 2024 16:36:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16F10402B1; Tue, 17 Dec 2024 16:36:39 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id CECB0402B1 for ; Tue, 17 Dec 2024 16:36:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734449797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V3uKE6KLBUwvuuCDmq8y225UzMm3BhAnsFA9cYEkZWw=; b=SQFVw4YQGwvUUmC1ANMfcSOYdOedpmvqxWbu1zimjqTUzL00xOWYcy7GLn2y/xzeg30LwZ 4WDYExNoRNtKM1X2xP+W8ZoZK68B1COR2ELHwbeplc3T0qFfrzRER28RI6erIgKkVVygqg whLPxvHZHGDtVOTKsREJbKq2ZYAI6P4= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-402-aCPuPl8cMriOZPCwOUyCiQ-1; Tue, 17 Dec 2024 10:36:34 -0500 X-MC-Unique: aCPuPl8cMriOZPCwOUyCiQ-1 X-Mimecast-MFC-AGG-ID: aCPuPl8cMriOZPCwOUyCiQ Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5486A19560BE; Tue, 17 Dec 2024 15:36:33 +0000 (UTC) Received: from max-p1.redhat.com (unknown [10.39.208.39]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8DDEF19560AD; Tue, 17 Dec 2024 15:36:31 +0000 (UTC) From: Maxime Coquelin To: stable@dpdk.org Cc: Olivier Matz , Maxime Gouin , Maxime Coquelin Subject: [PATCH 23.11] net/virtio: fix Rx checksum calculation Date: Tue, 17 Dec 2024 16:36:26 +0100 Message-ID: <20241217153626.460687-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: BtUZlMhgbbHL6plgg-9cSEeAZMrO4kFtXidvK95X2j4_1734449793 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Olivier Matz If hdr->csum_start is larger than packet length, the len argument passed to rte_raw_cksum_mbuf() overflows and causes a segmentation fault. Ignore checksum computation in this case. CVE-2024-11614 Fixes: ca7036b4af3a ("vhost: fix offload flags in Rx path") Signed-off-by: Maxime Gouin Signed-off-by: Olivier Matz Reviewed-by: Maxime Coquelin --- lib/vhost/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 5ec89719c6..49c2052eba 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -2831,6 +2831,9 @@ vhost_dequeue_offload(struct virtio_net *dev, struct virtio_net_hdr *hdr, */ uint16_t csum = 0, off; + if (hdr->csum_start >= rte_pktmbuf_pkt_len(m)) + return; + if (rte_raw_cksum_mbuf(m, hdr->csum_start, rte_pktmbuf_pkt_len(m) - hdr->csum_start, &csum) < 0) return; -- 2.47.0