From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37D8C606A333 for ; Sat, 5 Dec 2026 06:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=KULW+f+/ Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A28F840E26; Sat, 5 Dec 2026 07:26:02 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTPS id 000E340DF5 for ; Sat, 5 Dec 2026 07:25:58 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2f05b465cd1so12232735ad.3 for ; Fri, 04 Dec 2026 22:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796451957; x=1797056757; 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:content-type; bh=YdegCwJZe+8wV1ZkBZfClg126u7KdVJ2rIge1yrzoA0=; b=KULW+f+/+XTtWPi7nn70dPsvyRI7T9+YNrA5rdjbdBTKZgMBXvFDoBNhhIEFZaa/Qr 4BYqor+pSd0ndweesQur7/FC/17I/YhNtmjA3Us0j4JbV+TiHSaqrF0hTGtyRcG4QCa8 pZpjkUEh8GBpAeiuVjxArZz1gr0JDFOjgmfg4BhRItNZzudHpS5ntXVEYP8D/fLVZgIb ehlkgEb/OmLjJTxf5RHfVHUvR8eg8BjHPjUtWMbszz/8juTyZU0Nk8Zv/FntQWA1CSZh F5VrmRrLaEJfC2LQ9ChSWNCzmPXxOoBXbmKxaKjVpxK2Hw+ibiwouBmASTyZooRB91Ve Yd5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796451957; x=1797056757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=YdegCwJZe+8wV1ZkBZfClg126u7KdVJ2rIge1yrzoA0=; b=A1xoVHaw9LXhQTdknCVcY9AAP9kPM1fFpAglX4L2ubEu5/RzLYfx4b0FVxFiSpLBXf bfwq68Wpib9r18UeOp2LwJBwHh9zDCm2glzmT+t6jAETMldc7P9Gyy/O6qJkM10O+9uc 6n3JSVnlAc+LMvAiPFZYQ8DoHYpCnHrGm68OF66soc0Soi/xN/agGntfH+TlRY1tRGkT +ayZWBq63vM6Nu991mRKC9wMJzWDHVbQceFGCWabhH8Begf4ZbYHO2I5fKNvGyWjB4kN 2W8Vp4waalRE/57uqf1a40jG6Qy04tNRAyHk9TW9KjKCkaG0o40or2I3benw5WBq6dGq mRqA== X-Gm-Message-State: AB4q+uFouXF4IBRzTUkYhdxYMRUKrB3LhaU5TIocOC6HkyyDropyeFsU d1ijGFByPoSjy2mxf3m3GTzvuopGvGWaYx11Uob7D+oETvmeLS4x0Ts4y+tuG8kGJdz3jiNQu1N 3y1SLcYU= X-Gm-Gg: AZFdTZdPqyPTMiVV1TAfnnTsvCCiMAPZNXwbmXSsXqw6U2ifXVHMEOCN6gl3Cfs20K3 uoW1P5GCPBz0MCO+aqsvY7V6MqnfWdhk3CXBdnY9WJrh67xlYTG+nTPViNBQ/HVBs7sMSmPDWeQ SiC/HrZIarIv6oWO9YRBoH0unN4Ou/qrtqrHdpMXjqVNNeigm14LjgX7GausdRa62gjU42M0v9T 65XsXuEWe/ZlGxHRX0+zGUtiPuZdSyUClZT/u68K8NmnBCNT/khhwT+G98mFv6aDQMXKRJJAywq C2PLS8Br6VDjySUoYE8sTDSC6ECH5WpOSS9w5vkZUyDzOt72f8cdGXbyktXeXx+RV7WYQBZtd7B rZZWrmt4+wZjhCiJAhSvzUN8spEeJrqyD4+wBVOkl/ZUbC8gNzLAiNl5/OBqrKZUkcS/3WBE4bQ ZnjhgFWEOXx8MVF31miYMlexOGszhiKNjC6Bf1aYW8vWmQQAUASdu3EvMg5h4xbNYgwa1W/TjM2 9Kg6wTKAIz+Nf4MkzxC1ds3FtnXCMK9W/ZxZU+rPPmA93bxPpDVUPoP3Yw6xfghgW5aR+ruon8L pYp/MdKYUg9FPHsvsy3PNiyGkf0v+soQm9OeswHcXblLpHiK7u4//4dqVKDDIH/rzZY5 X-Received: by 2002:a17:90a:d884:b0:3b4:c9f8:abce with SMTP id 98e67ed59e1d1-3b5e0653e1bmr3224807a91.35.1796451957491; Fri, 04 Dec 2026 22:25:57 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b6168d3e2fsm1162797a91.2.2026.12.04.22.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 22:25:57 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Harman Kalra , Jerin Jacob , Santosh Shukla Subject: [PATCH v4 05/68] net/octeontx: fix port count parsing into wrong width Date: Fri, 4 Dec 2026 22:19:42 -0800 Message-ID: <20261205062551.19553-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261205062551.19553-1-stephen@networkplumber.org> References: <20260914054912.755403-1-stephen@networkplumber.org> <20261205062551.19553-1-stephen@networkplumber.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 parse_integer_arg() stores through an int pointer, but the caller passes ¶ms->nr_port, which is a uint8_t and the only member of a struct octeontx_vdev_init_params on the stack. Parsing nr_port therefore writes three bytes past the field. Store a uint8_t and reject a value which does not fit one. Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/octeontx/octeontx_ethdev.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index bde4c2c615..17c40f5708 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -70,14 +70,17 @@ static int parse_integer_arg(const char *key __rte_unused, const char *value, void *extra_args) { - int *i = (int *)extra_args; + uint8_t *u8 = extra_args; + int i; - *i = atoi(value); - if (*i < 0) { - octeontx_log_err("argument has to be positive."); + i = atoi(value); + if (i < 0 || i > UINT8_MAX) { + octeontx_log_err("argument has to be positive and fit in a byte."); return -1; } + *u8 = (uint8_t)i; + return 0; } -- 2.53.0