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 2D4E945C9B for ; Tue, 12 Nov 2024 23:10:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28C814064C; Tue, 12 Nov 2024 23:10:14 +0100 (CET) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mails.dpdk.org (Postfix) with ESMTP id 2B8424064C for ; Tue, 12 Nov 2024 23:10:13 +0100 (CET) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-431548bd1b4so53149005e9.3 for ; Tue, 12 Nov 2024 14:10:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731449413; x=1732054213; 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=oLXVCO47jZNJeKTKklBQXsLgDl9I/HiUpAssp/lGP3U=; b=Lw7x2LpJS4XkMcHRxUQ4zl+GFVmXlgzFWS8inDHrXT5qPnD+wdDI5oarmbDyVbL+Nh C8nvaAQGPYW34wjbeiFsgkUsiG4UruOLe5DzbfP+RXwEeXSVefe3OATSIqC9D0CGxe2p uX5L1rnzgD2sFX44LXhogzGbFhiCejxIq1n4Nyf5tp10X0j9S5JcSjuIAZVu7vZSMztB 9sBth7uarEngK/Q0jY/tYbQBdG6brBdUnmmAYAlSccimGOvAyoarp78hWaMwK+K/yz/0 TW5xu3bIb/8pquXb3PspxE0tSahRPl1rXePwU3uYNxliwl1q0Fl685V3Hz/ubKbApSej IDdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731449413; x=1732054213; 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=oLXVCO47jZNJeKTKklBQXsLgDl9I/HiUpAssp/lGP3U=; b=Q1irIUJ4Ut1pJ5yl168brMmqo8LknKffC4alALkeq8t+z+BLZGqoLD20weGRocf70D 0AvAi7Cy9dceen5ooMYs/KcoOb8JSSGcASLkE2H5OnrFqMVN8u5YfHJVZeC90SndiJ91 ZFIzx3vHgSsn720sjdodLrej5uoPpS9N7RX+gSzp5UynTDo2tBF5AMTzcS8VSC4c8ZGM XxmSV8PHUuQo20RGiuP6/Q+5cRwORLBGQPxsSwcqHNNdaOoPZroHoivzB+JhGr0+UVRO /LYEGPlmStM+0ZsF2qaJ53rfCZA+gGIPPctgsNuKnXQTl0r7rww+lfFQwIMTWkjPMYGd kNEQ== X-Forwarded-Encrypted: i=1; AJvYcCW8aNSuQoYxxWPt4f4MkUeQroXomKNaEr69mJvCv7ZSekEZy99VKHfi7Cy7b/zT63TeB8V1FlE=@dpdk.org X-Gm-Message-State: AOJu0Yxd/1MiZ7wVOPAspFT9ycUwrFQACq42igGxsYoOZY+0JBh7Qt0t gjfuXpCW7qhWl2Lm2NFthBNiC19DSySzugJpYS0wIW99iPHuQxXl/Tse6A== X-Google-Smtp-Source: AGHT+IFiojsNItLupaA2p9MyXO/5eHT7uS86lDxLikUMlew34lAdDHhW2RXtUGOm/Wnr4K0vQu7LYg== X-Received: by 2002:a05:600c:4ecf:b0:430:563a:b20a with SMTP id 5b1f17b1804b1-432b7505786mr146721425e9.11.1731449412570; Tue, 12 Nov 2024 14:10:12 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:e89d:e9a1:da72:2f9d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432d54f76b9sm1017985e9.14.2024.11.12.14.10.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 14:10:12 -0800 (PST) From: luca.boccassi@gmail.com To: Hanumanth Pothula Cc: Ali Alnubani , dpdk stable Subject: patch 'event/octeontx: fix possible integer overflow' has been queued to stable release 22.11.7 Date: Tue, 12 Nov 2024 22:07:46 +0000 Message-ID: <20241112220754.666489-36-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241112220754.666489-1-luca.boccassi@gmail.com> References: <20241023211704.1216956-79-luca.boccassi@gmail.com> <20241112220754.666489-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/14/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/4535755a94940156c976170701b9b18d64be9f8f Thanks. Luca Boccassi --- >From 4535755a94940156c976170701b9b18d64be9f8f Mon Sep 17 00:00:00 2001 From: Hanumanth Pothula Date: Fri, 25 Oct 2024 16:28:02 +0530 Subject: [PATCH] event/octeontx: fix possible integer overflow [ upstream commit 3e86eee028c69b98144e2c62ec48091467e790be ] The last argument passed to ssovf_parsekv() is an unsigned char*, but it is accessed as an integer. This can lead to an integer overflow. Hence, make ensure the argument is accessed as a char and for better error handling use strtol instead of atoi. Bugzilla ID: 1512 Fixes: 3516327e00fd ("event/octeontx: add selftest to device arguments") Signed-off-by: Hanumanth Pothula Tested-by: Ali Alnubani --- drivers/event/octeontx/ssovf_evdev.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index d5e223077d..62eeaf7136 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -714,10 +714,20 @@ ssovf_close(struct rte_eventdev *dev) } static int -ssovf_parsekv(const char *key __rte_unused, const char *value, void *opaque) +ssovf_parsekv(const char *key, const char *value, void *opaque) { - int *flag = opaque; - *flag = !!atoi(value); + uint8_t *flag = opaque; + uint64_t v; + char *end; + + errno = 0; + v = strtoul(value, &end, 0); + if ((errno != 0) || (value == end) || *end != '\0' || v > 1) { + ssovf_log_err("invalid %s value %s", key, value); + return -EINVAL; + } + + *flag = !!v; return 0; } -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-12 22:06:59.816542360 +0000 +++ 0036-event-octeontx-fix-possible-integer-overflow.patch 2024-11-12 22:06:58.687307516 +0000 @@ -1 +1 @@ -From 3e86eee028c69b98144e2c62ec48091467e790be Mon Sep 17 00:00:00 2001 +From 4535755a94940156c976170701b9b18d64be9f8f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3e86eee028c69b98144e2c62ec48091467e790be ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 3a933b1db7..957fcab04e 100644 +index d5e223077d..62eeaf7136 100644 @@ -27 +28 @@ -@@ -717,10 +717,20 @@ ssovf_close(struct rte_eventdev *dev) +@@ -714,10 +714,20 @@ ssovf_close(struct rte_eventdev *dev)