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 08EF643CAD for ; Thu, 14 Mar 2024 01:12:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01AC542E40; Thu, 14 Mar 2024 01:12:02 +0100 (CET) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id 0BC1E42E40 for ; Thu, 14 Mar 2024 01:11:59 +0100 (CET) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4132600824bso2349525e9.2 for ; Wed, 13 Mar 2024 17:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710375119; x=1710979919; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6+s2rScju7tyOZF7ngCqzj6/mvoYHkopbC01oqdDSio=; b=OGBPgMgeCPDmcUj7z7Q+e5HxX0850s62F9/JB6DOpJZhgh+X9SAUGQSDCX3RtB+vu1 KKfENWU3G2mtAHal/DExNS+rO3vP0VxCslwLQYCddTnkatjX9KddYvp0ZnGUzMmST7MO p5zVZAys02ZYDUev4tw+s7kxAWrI9RIQqtn0d05vbe38nWWm9wyjzE88kn+LuvEU+3vz Oti8NQAqWYlW0kpLeE/djn7gZe17BV6FjyCF+VHDFpFhZaN/lFeibeVW49xGEsa3BVHi 6zmLJkqfVA9sTO7LCujO3snfa+bSP/H6TlVZbpPPDajV1NlM0thiSF6bfU8p+OLYXY6M D9ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710375119; x=1710979919; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6+s2rScju7tyOZF7ngCqzj6/mvoYHkopbC01oqdDSio=; b=WoxXWzOH3wv+psLKbLsqOaOUeWmV0Mpg/b537tCMPbYTLiWUP+04SMU0ipK06fnBSh CoQryW3Vbnf3JzPlK/YfogBfhWrBjXmsH82+AxVvGEJahCEIIXzATg1G5z/yg3vsPLu6 6VoF4FRjmBdxkGFTnxqFtHjILW0pmv4n18Yb8skdg3BIqRdL6MJfS0OrIC/+ndgZ0qwE hs00iU4pxjL6B9YrE6WV4g2h19/uiN0s5pqvYEViP7G3iIl4rBjzH6HVmjf0/CJQc2Vm PPrd5vRGOdHEMpS05eq4qwM+pmBAS3g2adaeHVpiq3sKDb1r3e5ReB64CTjnmxrHLPO8 3i7Q== X-Forwarded-Encrypted: i=1; AJvYcCWFcopeSEl6Ui+PlJG3EKX0EUGqKmamesNO/TpkxMSYxSIm+Zy9eROoewP74xSY7YbM5loGo1cPi4XNt6fye98= X-Gm-Message-State: AOJu0YySK1x2zpuGeJKrGPAoF1K5zF86uNyZz4wNZVSb2pTjTjsyquI7 NSBffTVk9Zo+N/2BCcN6JZtKyWv+A3+Y4jNO8WElw4ktCWW/fRc/8+O2/GXv X-Google-Smtp-Source: AGHT+IFunodZv6lyn5crKPjOMKlf+egiR3cTyZM8/YUBo2rsCbCse+v13AXTD72GXSTTXRf+rs8Whg== X-Received: by 2002:a05:600c:a0e:b0:413:304a:a31 with SMTP id z14-20020a05600c0a0e00b00413304a0a31mr209149wmp.24.1710375118695; Wed, 13 Mar 2024 17:11:58 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:7aef:1aaa:3dff:d546]) by smtp.gmail.com with ESMTPSA id m15-20020a05600c4f4f00b004130c1dc29csm601441wmq.22.2024.03.13.17.11.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 17:11:58 -0700 (PDT) From: luca.boccassi@gmail.com To: Satheesh Paul Cc: Harman Kalra , dpdk stable Subject: patch 'common/cnxk: fix possible out-of-bounds access' has been queued to stable release 22.11.5 Date: Thu, 14 Mar 2024 00:09:33 +0000 Message-Id: <20240314000957.2810803-37-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240314000957.2810803-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-102-luca.boccassi@gmail.com> <20240314000957.2810803-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 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 Reviewed-by: Harman Kalra --- 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@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)