patch 'eal/linux: improve ASLR check' has been queued to stable release 24.11.3

Kevin Traynor ktraynor at redhat.com
Fri Jul 18 21:29:01 CEST 2025


Hi,

FYI, your patch has been queued to stable release 24.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/23/25. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/9d88498a1cf3abf2460b03ba691e6f8d32dd5a3d

Thanks.

Kevin

---
>From 9d88498a1cf3abf2460b03ba691e6f8d32dd5a3d Mon Sep 17 00:00:00 2001
From: Yang Ming <ming.1.yang at nokia-sbell.com>
Date: Thu, 13 Mar 2025 14:19:03 +0800
Subject: [PATCH] eal/linux: improve ASLR check

[ upstream commit dcf9f9363aa9b4163d241caf8b26a84ca0c0006b ]

This change ensures that the current process is checked for
being run with 'setarch' before verifying the value of
'/proc/sys/kernel/randomize_va_space'. The '-R' or
'--addr-no-randomize' parameter of the 'setarch' command is used
to disable the randomization of the virtual address space.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Yang Ming <ming.1.yang at nokia-sbell.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/eal/linux/eal_memory.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c
index 9dda60c0e1..5ef1575b66 100644
--- a/lib/eal/linux/eal_memory.c
+++ b/lib/eal/linux/eal_memory.c
@@ -16,4 +16,5 @@
 #include <sys/file.h>
 #include <sys/resource.h>
+#include <sys/personality.h>
 #include <unistd.h>
 #include <limits.h>
@@ -201,4 +202,15 @@ aslr_enabled(void)
 {
 	char c;
+
+	/*
+	 * Check whether the current process is executed with the command line
+	 * "setarch ... --addr-no-randomize ..." or "setarch ... -R ..."
+	 * This complements the sysfs check to ensure comprehensive ASLR status detection.
+	 * This check is necessary to support the functionality of the "setarch" command,
+	 * which can disable ASLR by setting the ADDR_NO_RANDOMIZE personality flag.
+	 */
+	if ((personality(0xffffffff) & ADDR_NO_RANDOMIZE) == ADDR_NO_RANDOMIZE)
+		return 0;
+
 	int retval, fd = open(RANDOMIZE_VA_SPACE_FILE, O_RDONLY);
 	if (fd < 0)
-- 
2.50.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-07-18 20:29:11.410768838 +0100
+++ 0007-eal-linux-improve-ASLR-check.patch	2025-07-18 20:29:10.808906957 +0100
@@ -1 +1 @@
-From dcf9f9363aa9b4163d241caf8b26a84ca0c0006b Mon Sep 17 00:00:00 2001
+From 9d88498a1cf3abf2460b03ba691e6f8d32dd5a3d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit dcf9f9363aa9b4163d241caf8b26a84ca0c0006b ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 8c896379fe..7f03bb517b 100644
+index 9dda60c0e1..5ef1575b66 100644
@@ -31 +32 @@
-@@ -204,4 +205,15 @@ aslr_enabled(void)
+@@ -201,4 +202,15 @@ aslr_enabled(void)



More information about the stable mailing list