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-next>] [day] [month] [year] [list]
Message-Id: <20240809094047.319917-1-gankulkarni@os.amperecomputing.com>
Date: Fri,  9 Aug 2024 02:40:47 -0700
From: Ganapatrao Kulkarni <gankulkarni@...amperecomputing.com>
To: james.clark@....com,
	mike.leach@...aro.org,
	suzuki.poulose@....com
Cc: leo.yan@....com,
	acme@...hat.com,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	darren@...amperecomputing.com,
	scclevenger@...amperecomputing.com,
	gankulkarni@...amperecomputing.com
Subject: [PATCH V2] perf scripts python arm-cs-trace-disasm.py: Skip disasm of discontiguous packets

Script uses contiguous address range of adjacent packets to generate
the tracing. When there is a continuity brake due to discontiguous
branch address, it is resulting in to a perf tool crash(segfault).
This is expected bhehaviour since the decoder is not expecting the
discontiguous packets.

Adding an option "force" to allow the decoder to continue and complete
the tracing without application crash by dropping the discontiguous
packets from decoding.

Signed-off-by: Ganapatrao Kulkarni <gankulkarni@...amperecomputing.com>
---

Changes since V1:
	Updated patch as per discussions[1].

[1] https://lore.kernel.org/linux-arm-kernel/ce4af204-874f-404c-a7aa-42dc6693d072@linaro.org/T/ 

 tools/perf/scripts/python/arm-cs-trace-disasm.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py
index d973c2baed1c..65d59db3bcec 100755
--- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
+++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
@@ -36,7 +36,10 @@ option_list = [
 		    help="Set path to objdump executable file"),
 	make_option("-v", "--verbose", dest="verbose",
 		    action="store_true", default=False,
-		    help="Enable debugging log")
+		    help="Enable debugging log"),
+	make_option("-f", "--force", dest="force",
+		    action="store_true", default=False,
+		    help="Force decoder to continue")
 ]
 
 parser = OptionParser(option_list=option_list)
@@ -257,6 +260,13 @@ def process_event(param_dict):
 		print("Stop address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (stop_addr, int(dso_start), int(dso_end), dso))
 		return
 
+	if (stop_addr < start_addr):
+		if (options.verbose or not options.force):
+			print("Packet Discontinuity detected [stop_add:0x%x start_addr:0x%x ] for dso %s" % (stop_addr, start_addr, dso))
+			print("Use option '-f' following the script for force mode")
+		if (options.force):
+				return
+
 	if (options.objdump_name != None):
 		# It doesn't need to decrease virtual memory offset for disassembly
 		# for kernel dso and executable file dso, so in this case we set
-- 
2.44.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ