[dpdk-stable] patch 'eal/windows: check callback parameter of alarm functions' has been queued to stable release 20.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 26 15:53:01 CEST 2021


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 <jizh at linux.microsoft.com>
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 <jizh at linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
---
 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 at 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


More information about the stable mailing list