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 B01CE45D5D for ; Thu, 21 Nov 2024 00:43:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9F9240296; Thu, 21 Nov 2024 00:43:09 +0100 (CET) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mails.dpdk.org (Postfix) with ESMTP id 2550D4327F for ; Thu, 21 Nov 2024 00:43:08 +0100 (CET) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-431616c23b5so1417115e9.0 for ; Wed, 20 Nov 2024 15:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732146188; x=1732750988; 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=OE+kLU7tRhmhQaVUgRRvKADVOvN1RoEYv2aPIQHkdYg=; b=StIV8YaBL/iDmJJqUPRR58ivnoeEQeU2mHoLlpWA1OARrHcc3ZLniGA/C0M2Srt8Bt iqPPQks5UO/E9rdsqHlyPn5+78fzblDP8arhK2rhNHmlthvYJNSOKyqljCGSCAZ18WRt 3P6Hih4V8DP09EPrQYpP7sjkiiom+dI3KXwG9oQQL5kcGYnnwQtb2X7t6IA3ReLJcfQh LCGXtylMqhbrMsH17VmS/MvMJPX1YlU7QMPOXjbpHu3WahzqCgUemmUo8310GOICQuAm LqnyB3DgHZjqmTjslIfHLoRulu+4qi4z9C4sUiv00HY9n/5svq2wWJAI3hjEnMNGIJtm 1MRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732146188; x=1732750988; 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=OE+kLU7tRhmhQaVUgRRvKADVOvN1RoEYv2aPIQHkdYg=; b=Tq4pr2Uoo4Gp+6y9c8zI4SzSF7F22qiJK1Blz6yudTPl9gspUsffbJR+VXbxMtGsQB N/+nYbWUxJ5bswoBUXGRS8iQNbIGxhMYEIYrl/mvxcY0LIdS9eu3z0Txyu5KHtIfC9Eb UUtpvLQ2sk3Cb+EaFU+CvjMO3Q2tnZaAwxPscdLG5XDCqVEI/n+fhLZwI26/IlPbp+ns fiWIaP85dpptrd9bhyHtunnQ7ys4QLHIYhUkM+hQYqNhIbQPODRrM+GVax8mu/KT8NRH 5cn9Bd85zJDo1gxrmORAo+DIwO6GTgBcjJhsPD1kruqOT3YE1C3stqUyh1ECIxms0RDv mlbg== X-Forwarded-Encrypted: i=1; AJvYcCUM51qlOlqqzKUePmnViObdxPaq8GObPgNE7XylAF4ztqYhP+B2Z1I9IHU+uUyQS49r9rdSws8=@dpdk.org X-Gm-Message-State: AOJu0Yy5ZWfhA9Z1cmSguwIajr2+IxGxPnQM7eNVFeOslEgM6t5TjyFX aRxZJ5GHmZ43j+BcOqgdj+W/XcbUamObGSX509ME2FMPAVFq2M4s X-Google-Smtp-Source: AGHT+IEaLLK1p7OZggwp02sRghwH5kdj11CQbyNAq7KnBreWLJKCA2IXP0VDHXzocFqKPnQR67MAsA== X-Received: by 2002:a05:600c:548d:b0:42c:b67b:816b with SMTP id 5b1f17b1804b1-433c5c889a4mr9302735e9.1.1732146187666; Wed, 20 Nov 2024 15:43:07 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432f642f15esm66623685e9.0.2024.11.20.15.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 15:43:07 -0800 (PST) From: luca.boccassi@gmail.com To: Bruce Richardson Cc: Jerin Jacob , dpdk stable Subject: patch 'eventdev: fix possible array underflow/overflow' has been queued to stable release 22.11.7 Date: Wed, 20 Nov 2024 23:41:38 +0000 Message-ID: <20241120234215.233355-13-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241120234215.233355-1-luca.boccassi@gmail.com> References: <20241112220754.666489-40-luca.boccassi@gmail.com> <20241120234215.233355-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.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/22/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/af71652ab753ab73541c70000d74a3224a2e5df7 Thanks. Luca Boccassi --- >From af71652ab753ab73541c70000d74a3224a2e5df7 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 14 Nov 2024 11:55:38 +0000 Subject: [PATCH] eventdev: fix possible array underflow/overflow [ upstream commit 952b24bd0475450e548d4aafae7d8cf48258402b ] If the number of interrupts is zero, then indexing an array by "nb_rx_intr - 1" will cause an out-of-bounds write Fix this by putting in a check that nb_rx_intr > 0 before doing the array write. Coverity issue: 448870 Fixes: 3810ae435783 ("eventdev: add interrupt driven queues to Rx adapter") Signed-off-by: Bruce Richardson Acked-by: Jerin Jacob --- lib/eventdev/rte_event_eth_rx_adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index b4f05f250c..bd971fb63a 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -2293,7 +2293,7 @@ rxa_sw_add(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, for (i = 0; i < dev_info->dev->data->nb_rx_queues; i++) dev_info->intr_queue[i] = i; } else { - if (!rxa_intr_queue(dev_info, rx_queue_id)) + if (!rxa_intr_queue(dev_info, rx_queue_id) && nb_rx_intr > 0) dev_info->intr_queue[nb_rx_intr - 1] = rx_queue_id; } -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-20 23:41:23.166425319 +0000 +++ 0013-eventdev-fix-possible-array-underflow-overflow.patch 2024-11-20 23:41:22.708195467 +0000 @@ -1 +1 @@ -From 952b24bd0475450e548d4aafae7d8cf48258402b Mon Sep 17 00:00:00 2001 +From af71652ab753ab73541c70000d74a3224a2e5df7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 952b24bd0475450e548d4aafae7d8cf48258402b ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 3ee20d95f3..39674c4604 100644 +index b4f05f250c..bd971fb63a 100644 @@ -24 +25 @@ -@@ -2299,7 +2299,7 @@ rxa_sw_add(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, +@@ -2293,7 +2293,7 @@ rxa_sw_add(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id,