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 BA8D745D0B for ; Fri, 15 Nov 2024 07:08:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5F9942F95; Fri, 15 Nov 2024 07:08:00 +0100 (CET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id A775542F65 for ; Fri, 15 Nov 2024 07:07:55 +0100 (CET) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-2ea0f283a82so806268a91.1 for ; Thu, 14 Nov 2024 22:07:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731650875; x=1732255675; 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=uUuh8YUBHlS+h1FpglCbyQEOVWWPo9BM+tBZMeNdbPU=; b=Hj36YXgQvEFCFQ+4aycfypJlc8MKXjsHWk0oIaScvdgUB3id2zjnftQLmw7SHHsM7c ljhwTF3WlxgPDpLCENOZPrVqsU0s8nRcQHYwfM+54yvKFR6P5vliC6Qp+/W9YqdGnxWD rRGIsh5swDbrp0s0dqMiCjaayGpeEEtfPz2MUbPK1ANgWwTF8exb1/s+Vbg7UWJQb6D4 TrEBwq+BrTdKfKU89O7BgEjSdKM7SUtq/XutxwwQxAc8tME4NQJ1pF8s0uC/tT0nSgTe dXOUguH8/mDIbgK5jUdBikqf0Rizg76VvEkDOpI5f+/DYGaUnbB5B936StpJh0MFVDSc GUPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731650875; x=1732255675; 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=uUuh8YUBHlS+h1FpglCbyQEOVWWPo9BM+tBZMeNdbPU=; b=ZJb/LEHcDIw1zcnTBwkvHNYRtB5yV+Tu2FqCZg7ho9XisH2TGWmeLfcibAAfwQ6LYb pT5D3FTINubeE5JnYQBaAB7dA4D78sZnQkD7tcyaGX8hpEuWTNXVQQm8Fak7H89RIXsN s0ZVBq4roBkjHXxi9eQ1RVmW0E/KDDPoanQ2pMLKyPE1vidwRzl3UMJ2RiAIbAZLCn5e a65oIqZObcdsTPklgqGdoWDzPUfxP++pjIv7mAbxjX2bRfij7e2qAJ53lMTBWzTZKmvt nJD21A+WHlI/JjzoZ+lSC2Zevs2oh5ltIKmzmtq49VaRLtFEz7fkmi6d+N6vYsoVrKKB 9YPQ== X-Forwarded-Encrypted: i=1; AJvYcCWMAi93+PeTtxzjsOt7BClmX6CMfuc0QOGEQ00GKPlQhEK8zTmhRLzB19JmdX/HglzFnjNeQis=@dpdk.org X-Gm-Message-State: AOJu0YyDWG43dH5BaslXD+y3qeVHFe/Do+v1LJFe6x/gjHdd8S6vmiP7 usQ6aT4YMxIvTuW2vFI2sPlemKp4EApNALHrEid71ZbtqVB7TUuEt9cYLa4TUgIMULurkM3kmZA n X-Google-Smtp-Source: AGHT+IHyKJCoVfEKK6DGUHq+IgetfGkkMtw3AakfcNxr5iyWeRef18Mujup7m9KjtRBG9+u/27qOkg== X-Received: by 2002:a17:90b:3b45:b0:2e9:48d0:3b59 with SMTP id 98e67ed59e1d1-2ea154cd18dmr2167383a91.8.1731650874862; Thu, 14 Nov 2024 22:07:54 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea06f4856esm2123781a91.23.2024.11.14.22.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 22:07:54 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , xuemingl@nvidia.com, stable@dpdk.org, Tyler Retzlaff , Gaetan Rivet Subject: [PATCH 06/16] eal: fix out of bounds access in devargs Date: Thu, 14 Nov 2024 22:05:43 -0800 Message-ID: <20241115060738.313190-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241115060738.313190-1-stephen@networkplumber.org> References: <20241115060738.313190-1-stephen@networkplumber.org> 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 The code for parsing layers in devargs could reference past the end of layers[] array on stack. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: 9a1a9e4a2ddd ("devargs: support path value with global device syntax") Cc: xuemingl@nvidia.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_devargs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c index a64805b268..dd857fc839 100644 --- a/lib/eal/common/eal_common_devargs.c +++ b/lib/eal/common/eal_common_devargs.c @@ -88,7 +88,7 @@ rte_devargs_layers_parse(struct rte_devargs *devargs, s = devargs->data; while (s != NULL) { - if (nblayer > RTE_DIM(layers)) { + if (nblayer >= RTE_DIM(layers)) { ret = -E2BIG; goto get_out; } -- 2.45.2