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: <20210305183948.37738-1-andriy.shevchenko@linux.intel.com>
Date:   Fri,  5 Mar 2021 20:39:48 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Borislav Petkov <bp@...e.de>, linux-kernel@...r.kernel.org
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 1/1] scripts/decodecode: Decode 32-bit code correctly on x86_64

On x86_64 host the objdump uses current architecture which is 64-bit
and hence decodecode shows wrong instructions.

Fix it by supplying '-M i386' in case of ARCH i?86 or x86.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
 scripts/decodecode | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/scripts/decodecode b/scripts/decodecode
index 31d884e35f2f..020a84982249 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -75,21 +75,25 @@ disas() {
 
 	${CROSS_COMPILE}as $AFLAGS -o $t.o $t.s > /dev/null 2>&1
 
-	if [ "$ARCH" = "arm" ]; then
+	case "$ARCH" in
+	arm)
 		if [ $width -eq 2 ]; then
 			OBJDUMPFLAGS="-M force-thumb"
 		fi
 
 		${CROSS_COMPILE}strip $t.o
-	fi
-
-	if [ "$ARCH" = "arm64" ]; then
+		;;
+	arm64)
 		if [ $width -eq 4 ]; then
 			type=inst
 		fi
 
 		${CROSS_COMPILE}strip $t.o
-	fi
+		;;
+	i?86|x86)
+			OBJDUMPFLAGS="-M i386"
+		;;
+	esac
 
 	if [ $pc_sub -ne 0 ]; then
 		if [ $PC ]; then
-- 
2.30.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ