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 CA40F45CD8 for ; Mon, 18 Nov 2024 19:22:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AAAC0427DA; Mon, 18 Nov 2024 19:22:12 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 609C6427AF for ; Mon, 18 Nov 2024 19:22:08 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-20c7ee8fe6bso44350825ad.2 for ; Mon, 18 Nov 2024 10:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731954127; x=1732558927; 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=c7GV9qrfvKqsAT+ehO/KNx31ZFz4RF8FZPDqbAi8IHhqMdsitIUI8dXRwQNvSeVoaF s6P5IHa/UUEwaPiRFjX9O+f6dOwLsKSZhn3CvdADPAvdepSA3yFXiG7EYp2SW9SPI7DM f1isqsxQdeFsKGjtvst5Xv53GI15m8Ro3MmdTLZoFf+wBEdhI2usZXQdbJHnXG3DiOsR DJ6uy4BmMKpIqgXZ1qtOXt6Kx5xWCRrJLWUjik/1p5vB8oGDu4mY9g+CBHL36Xe03mYc t4btUVi6Y/yU4tXj9+xf/DfHlNUkdWLPTT1A4fS+9rMncfVA1jDbDKESmV4utcQ+9DlF Um5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731954127; x=1732558927; 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=qvrbsAVNx2rShRFJrmTRQTikaM68V3Xy8DVyFyFrPSNMJy9kW9SKnLk8K/ikzD7Ou2 RWIg6vwgb2elqmKO4qsD0S8ni1i/RFK30ikjP+9xvZSQlNDRnJHbR6jbtzWPo8zadGJa D8UEA/E3PIp7e4GtLfqgY5E1zb9aRbyh8qSCg05m4D6xWtm/cTnir7P0q2MNxq7u14qN DIO11X8hl3ICshS7Mo4dRG1Wk5E+xk2Pc4loV0nmqEPnkfwEeBHlDoC0u3u26q+GZEp3 IQwAwIeqND9867/Ic86tOguioYdZKjnYb/ItLG3DsV5aFjbMlVTpt6ioHuHDJ+XKRWwa rF6A== X-Forwarded-Encrypted: i=1; AJvYcCWXlbCjfWkL2faLk1UD/LeCGV3jWcLKUgdDBS/ZacNtRjD56hQl7gPIslxn3XRWriNuGvxNBE0=@dpdk.org X-Gm-Message-State: AOJu0YyRTOFkXL94KiPEaEK4UbR2uQ9P9c3WRDseITo3ZGxFiaTx0mwz DXXxMGVVQ2HhOhPh0LsS9VD2l0A3Wa1h9n+Rmv42WSBB6m5EPe+43Tn0pw6bzQ0= X-Google-Smtp-Source: AGHT+IGoNKOwcB2IsvQGgWUpsOeKa1Mm9YmmraE9zKA5hvIx2FHfiBVPkMvNpDmpkFIAvbQGzRz6UA== X-Received: by 2002:a17:902:da8b:b0:20c:d2d9:766f with SMTP id d9443c01a7336-211d0d724bdmr177957305ad.14.1731954127577; Mon, 18 Nov 2024 10:22:07 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea61869bb2sm2916724a91.12.2024.11.18.10.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 10:22:07 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , xuemingl@nvidia.com, stable@dpdk.org Subject: [PATCH v2 06/19] eal: fix out of bounds access in devargs Date: Mon, 18 Nov 2024 10:20:47 -0800 Message-ID: <20241118182153.87042-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241118182153.87042-1-stephen@networkplumber.org> References: <20241115060738.313190-1-stephen@networkplumber.org> <20241118182153.87042-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