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 8DDCA468E4 for ; Thu, 12 Jun 2025 23:08:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88C9942DD9; Thu, 12 Jun 2025 23:08:03 +0200 (CEST) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id 4F03E42DD9 for ; Thu, 12 Jun 2025 23:08:02 +0200 (CEST) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-450cfb79177so8521475e9.0 for ; Thu, 12 Jun 2025 14:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749762482; x=1750367282; 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=32HhoiE49ki/BA9IsdzbkYbGjmOiJ88v+KvxiZPb/x0=; b=MChNs77tkkcU3USnHi0l+W8D6b39i1vEiZnhGLmBJfV2d0GaaKBeen8SbcrDpC9RXT ThCua3r+NTCdO3MeI/VfqPPb3fLP2/Wu586TYKY17GywnUoiOA26WTw+7TxLWy52uaA8 4WAmBlqM++BibI6CNVJFlcnSdADOqWZika4p8ILt0to0lmzH/g4bQCRNdh3EiTmYQLNo Z5eXZ7wuB5bGUF/6/X+rnsHpfzQY/cYdYhAov6fWUwiM0Nn5S4RgJYHhSJZt18jFSZyU zkH4TYWeQ2RSYo0p1gOiIjUVVylueg7yg6Aa+GtOupexJYrG/FL0rPgtUEU5RE3fKz+8 DKAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749762482; x=1750367282; 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=32HhoiE49ki/BA9IsdzbkYbGjmOiJ88v+KvxiZPb/x0=; b=LSB1lnvfOBCwoQWQjU7IQNXE2E9ICFvJ2BguCvjUH9s7l1hoi9Gkaq1BAaLHlFtYbf drTENFl4Bfy3MJ45SW2hIKvk1T9IcSZw96F4J3/n3uQlCNtyY82XS2Zv3K5sp/F7/UV7 YDN0fOqQZIMAQt3gcM3ucLsfgm5NnC/+pzMh1oKSGCv/2qzDeqFcob9oDDb9I3SI6Pnc pjTZq19ZSwDmZOgnXhh8h2wiFEogmfTx8CFcMd2LW/YSYyynzz4bVPG3k1WRKH9dVW4e yby4gHpYvZubjQZ3tMXZSfQvSx3Bzb+WaWtHM+MWYSTn6xpqoCeURQkU0LtCCDhQ/D5K uOyg== X-Forwarded-Encrypted: i=1; AJvYcCXtEyZzaJBQQSmss5jG3/9VDiT/vUfsChZne36xCwdwE4QXgypTMWyXSmwm80qcZZOeQFHeY0w=@dpdk.org X-Gm-Message-State: AOJu0YxkH+GevheisuRRSjgay2f1DmbgkJq60ZU9IwbdfkJqvXpjJlTw Kd7fmOFzelA6hS2KseegM4FAj5s92Wwb/17R2RKNyx5rySasPDAqJaR/8jZv/ccN X-Gm-Gg: ASbGncvg1SN4imznS9CvVN3Kc4fAAYvi15XG0DQXefC87tKx7XZnOpZds6HGvpXOGTF d5LlOwp9Gny8HdEz92GUGtrCPI3VzXRauOSzb+gCGzvnxzJ8cx00Jk/JIb9GX99a6WeQ9QxwBVB 48nQsag0UsUrY9HbtkdUdshbvkWWgq7Dz4VTgtFADHoh0fWyAOEYQgFuUqdjThtSIBSLbW35ytE e8Ba3HVt1N5Z6X2wmF6rjFpobIZVmpx0mmTr/O3Or1lyPM9LqlIj9u9vuqSQXgeY7Eeaw0+rVNc AgSFuxHMVI3XcTgaINS68WvVE29h3p2MknGywkHA65KSClaDTL0/pUoSkKUvu22jSgfR X-Google-Smtp-Source: AGHT+IFwfvLcyPvKOZmgGMsjHTqbRnbwjf6+964E2qaxvpIk08LkdN5j4beTFDaBYLD8BOSDSnVG0Q== X-Received: by 2002:a05:600c:4fd6:b0:450:d367:c385 with SMTP id 5b1f17b1804b1-45334ae6432mr5541235e9.16.1749762481768; Thu, 12 Jun 2025 14:08:01 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:f2df:571a:ae4c:bef2]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3a568b087f8sm376127f8f.53.2025.06.12.14.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jun 2025 14:08:01 -0700 (PDT) From: luca.boccassi@gmail.com To: Yang Ming Cc: Stephen Hemminger , dpdk stable Subject: patch 'eal/linux: improve ASLR check' has been queued to stable release 22.11.9 Date: Thu, 12 Jun 2025 22:06:26 +0100 Message-ID: <20250612210733.2506558-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250612210733.2506558-1-luca.boccassi@gmail.com> References: <20250612210733.2506558-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.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/14/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/8018291e554d7be93deca317cd0eaaaa2dccbb85 Thanks. Luca Boccassi --- >From 8018291e554d7be93deca317cd0eaaaa2dccbb85 Mon Sep 17 00:00:00 2001 From: Yang Ming 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 Acked-by: Stephen Hemminger --- 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 077f77d406..ffdb836b7e 100644 --- a/lib/eal/linux/eal_memory.c +++ b/lib/eal/linux/eal_memory.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -200,6 +201,17 @@ static int 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) return -errno; -- 2.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-06-12 22:06:24.235698259 +0100 +++ 0009-eal-linux-improve-ASLR-check.patch 2025-06-12 22:06:23.794043032 +0100 @@ -1 +1 @@ -From dcf9f9363aa9b4163d241caf8b26a84ca0c0006b Mon Sep 17 00:00:00 2001 +From 8018291e554d7be93deca317cd0eaaaa2dccbb85 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit dcf9f9363aa9b4163d241caf8b26a84ca0c0006b ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 8c896379fe..7f03bb517b 100644 +index 077f77d406..ffdb836b7e 100644 @@ -33 +34 @@ -@@ -203,6 +204,17 @@ static int +@@ -200,6 +201,17 @@ static int