lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <95df5a08acc2c87e8ff9e374f9ae1c56cdc59470.1724104248.git.scclevenger@os.amperecomputing.com>
Date: Tue, 20 Aug 2024 16:11:33 -0600
From: Steve Clevenger <scclevenger@...amperecomputing.com>
To: james.clark@....com,
	mike.leach@...aro.org
Cc: suzuki.poulose@....com,
	leo.yan@...aro.org,
	ilkka@...ampercomputing.com,
	coresight@...ts.linaro.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	"steve.c.clevenger.ampere" <scclevenger@...amperecomputing.com>
Subject: [PATCH 3/5] Force MAPPING_TYPE__IDENTIY for PIE

From: "steve.c.clevenger.ampere" <scclevenger@...amperecomputing.com>

Use dso__is_pie() to check whether the DSO file is a Position
Independent Executable (PIE). If PIE, change the MAPPING_TYPE to
MAPPING_TYPE__IDENTITY so a zero map pgoff (text offset) is passed
into the script.

Signed-off-by: steve.c.clevenger.ampere <scclevenger@...amperecomputing.com>
---
 tools/perf/util/map.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index e1d14936a60d..df7c06fc373e 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -171,8 +171,11 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
 		assert(!dso__kernel(dso));
 		map__init(result, start, start + len, pgoff, dso);
 
+		if (map->pgoff && !no_dso)
+			no_dso = dso__is_pie(dso);	// PIE check
+
 		if (anon || no_dso) {
-			map->mapping_type = MAPPING_TYPE__IDENTITY;
+			map__set_mapping_type(map, MAPPING_TYPE__IDENTITY);
 
 			/*
 			 * Set memory without DSO as loaded. All map__find_*
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ