patch 'common/cnxk: fix possible out-of-bounds access' has been queued to stable release 22.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 14 01:09:33 CET 2024


Hi,

FYI, your patch has been queued to stable release 22.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/16/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f29c2d6b20f766d3e70bf98fcda41276ddb8f0bf

Thanks.

Luca Boccassi

---
>From f29c2d6b20f766d3e70bf98fcda41276ddb8f0bf Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh at marvell.com>
Date: Fri, 1 Mar 2024 09:05:34 +0530
Subject: [PATCH] common/cnxk: fix possible out-of-bounds access

[ upstream commit 9a92937cf0c836b7f2b5e303523279ddf9473a35 ]

The subtraction expression in mbox_memcpy() can wrap around
causing an out-of-bounds access. Added a check on 'size' to
fix this.

Coverity issue: 384431, 384439
Fixes: 585bb3e538f9 ("common/cnxk: add VF support to base device class")

Signed-off-by: Satheesh Paul <psatheesh at marvell.com>
Reviewed-by: Harman Kalra <hkalra at marvell.com>
---
 drivers/common/cnxk/roc_dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c
index 31f80f6717..67fffc89fe 100644
--- a/drivers/common/cnxk/roc_dev.c
+++ b/drivers/common/cnxk/roc_dev.c
@@ -466,6 +466,8 @@ pf_vf_mbox_send_up_msg(struct dev *dev, void *rec_msg)
 	size_t size;
 
 	size = PLT_ALIGN(mbox_id2size(msg->hdr.id), MBOX_MSG_ALIGN);
+	if (size < sizeof(struct mbox_msghdr))
+		return;
 	/* Send UP message to all VF's */
 	for (vf = 0; vf < vf_mbox->ndevs; vf++) {
 		/* VF active */
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-14 00:09:22.398482021 +0000
+++ 0037-common-cnxk-fix-possible-out-of-bounds-access.patch	2024-03-14 00:09:20.625615459 +0000
@@ -1 +1 @@
-From 9a92937cf0c836b7f2b5e303523279ddf9473a35 Mon Sep 17 00:00:00 2001
+From f29c2d6b20f766d3e70bf98fcda41276ddb8f0bf Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9a92937cf0c836b7f2b5e303523279ddf9473a35 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 084343c3b4..14aff233d5 100644
+index 31f80f6717..67fffc89fe 100644
@@ -24 +25 @@
-@@ -502,6 +502,8 @@ pf_vf_mbox_send_up_msg(struct dev *dev, void *rec_msg)
+@@ -466,6 +466,8 @@ pf_vf_mbox_send_up_msg(struct dev *dev, void *rec_msg)


More information about the stable mailing list