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 39147A0C47 for ; Mon, 26 Jul 2021 15:55:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 338D440DDA; Mon, 26 Jul 2021 15:55:25 +0200 (CEST) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mails.dpdk.org (Postfix) with ESMTP id BEA43410EA for ; Mon, 26 Jul 2021 15:55:22 +0200 (CEST) Received: by mail-wr1-f41.google.com with SMTP id l4so11202494wrs.4 for ; Mon, 26 Jul 2021 06:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=noiSjKLC57m3xyHk54PJ5S477q/iq1MgJR6SQ632neM=; b=m0WlushgqLQ+2CSk12VIFTEsYGkR87IteVkKsefF+9JVgbc4VAU/b7j/Un92D12sez loCwJOZQ6yT889BJJLUUKC6qBi0Jb2iiYP97oK1fSbPvfTxNn8/TBgpqS8QlLgQxMy2k UyCQj3Z6KiFEZYfdM+gQOmYnCgQVUaDUNyRIHMBdfIp3bwIjA8XcPSTJKuUXolJucs3/ o1zs9xh02Av3YHlpl+i8XwIQpAzL2REB3rSoV09RkyHpC9MdcxvnpYFVpoeC0b7IAaat HwMAbOcSiJ02VHgSij5se6/5td69fRG7feC/dZoHL7177TubUs6kdJXVNKmLPFmT6Qjk /FpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=noiSjKLC57m3xyHk54PJ5S477q/iq1MgJR6SQ632neM=; b=Buncqrv9KpgMC584IJdzVb2bUBwK/WoKYV5mM4zEynU/0EpRkby0UTyTd1WtHC8zcn lfo3/ig8hHqb5TeUACoEJ5Inj4w9sth7+fZdop2jx+FOAETw4mWKL9ZqA25Co0b0spc2 kLJ+aqd2lgNmyDMtdcSbsJBd+kJ66SZXSAEgZGuSGTx8oXfqr64hi0wFwoSbnId1xPCL TtaNvZJ7fd7JZD//TTZ+D2qNWvhxfKR0zJmgtt16NBUXkwxNHQOiZ0LCg8YJXzhsFWim G1Git6Re7pRpidAoFBN2wf/rxj2lGtI98N5MrrzehUImEyogfAzmJTw2OcccvPxeYR90 ZcyQ== X-Gm-Message-State: AOAM533GyMJWW3CmTHVptyqQ+KBNenJqVC1Rq/pWfMGKWORhsA9/qBzc QRYag+O/oT9rSz1iU3NiZoFG1yjg+BMC7hbc X-Google-Smtp-Source: ABdhPJxj/lNia55ZcTpLL1v9Q8f3pC7BiRzDMd2TJaM2j4qV1tX2OEIVv/0mU5jc3+wmgyLcUV7h9w== X-Received: by 2002:a5d:6dac:: with SMTP id u12mr19383562wrs.153.1627307722488; Mon, 26 Jul 2021 06:55:22 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id c15sm1698572wrx.70.2021.07.26.06.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:55:22 -0700 (PDT) From: luca.boccassi@gmail.com To: Jie Zhou Cc: Dmitry Kozlyuk , dpdk stable Date: Mon, 26 Jul 2021 14:53:01 +0100 Message-Id: <20210726135322.149850-38-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726135322.149850-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> <20210726135322.149850-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'eal/windows: check callback parameter of alarm functions' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/28/21. 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/ce81944f3dc9dd1a6b48674e7e5c603461c71f75 Thanks. Luca Boccassi --- >From ce81944f3dc9dd1a6b48674e7e5c603461c71f75 Mon Sep 17 00:00:00 2001 From: Jie Zhou Date: Wed, 7 Jul 2021 13:25:38 -0700 Subject: [PATCH] eal/windows: check callback parameter of alarm functions [ upstream commit b8617fcc511cd1cba3c32632612265b5d0f1184b ] EAL functions rte_eal_alarm_set() and rte_eal_alarm_cancel() did not for invalid parameters in Windows implementation, which is caught by the unit test alarm_autotest. Enforce parameter check to fail fast for invalid parameters. Fixes: f4cbdbc7fbd2 ("eal/windows: implement alarm API") Signed-off-by: Jie Zhou Acked-by: Dmitry Kozlyuk --- lib/librte_eal/windows/eal_alarm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/librte_eal/windows/eal_alarm.c b/lib/librte_eal/windows/eal_alarm.c index f5bf88715a..e5dc54efb8 100644 --- a/lib/librte_eal/windows/eal_alarm.c +++ b/lib/librte_eal/windows/eal_alarm.c @@ -91,6 +91,12 @@ rte_eal_alarm_set(uint64_t us, rte_eal_alarm_callback cb_fn, void *cb_arg) LARGE_INTEGER deadline; int ret; + if (cb_fn == NULL) { + RTE_LOG(ERR, EAL, "NULL callback\n"); + ret = -EINVAL; + goto exit; + } + /* Calculate deadline ASAP, unit of measure = 100ns. */ GetSystemTimePreciseAsFileTime(&ft); deadline.LowPart = ft.dwLowDateTime; @@ -180,6 +186,12 @@ rte_eal_alarm_cancel(rte_eal_alarm_callback cb_fn, void *cb_arg) bool executing; removed = 0; + + if (cb_fn == NULL) { + RTE_LOG(ERR, EAL, "NULL callback\n"); + return -EINVAL; + } + do { executing = false; -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-26 13:53:17.877004050 +0100 +++ 0038-eal-windows-check-callback-parameter-of-alarm-functi.patch 2021-07-26 13:53:15.893293547 +0100 @@ -1 +1 @@ -From b8617fcc511cd1cba3c32632612265b5d0f1184b Mon Sep 17 00:00:00 2001 +From ce81944f3dc9dd1a6b48674e7e5c603461c71f75 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b8617fcc511cd1cba3c32632612265b5d0f1184b ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -18 +19 @@ - lib/eal/windows/eal_alarm.c | 12 ++++++++++++ + lib/librte_eal/windows/eal_alarm.c | 12 ++++++++++++ @@ -21 +22 @@ -diff --git a/lib/eal/windows/eal_alarm.c b/lib/eal/windows/eal_alarm.c +diff --git a/lib/librte_eal/windows/eal_alarm.c b/lib/librte_eal/windows/eal_alarm.c @@ -23,2 +24,2 @@ ---- a/lib/eal/windows/eal_alarm.c -+++ b/lib/eal/windows/eal_alarm.c +--- a/lib/librte_eal/windows/eal_alarm.c ++++ b/lib/librte_eal/windows/eal_alarm.c