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: <1332411501-8059-3-git-send-email-wolfgang.mauerer@siemens.com>
Date:	Thu, 22 Mar 2012 11:18:21 +0100
From:	Wolfgang Mauerer <wolfgang.mauerer@...mens.com>
To:	rostedt@...dmis.org
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH 2/2, trace-cmd] Fix trace_printk for long integers

On 32 bit systems, a conversion of the trace_printk format string
"%lu" -> "%llu" is intended (similar for %lx etc.) when a
trace was taken on a machine with 64 bit long integers. However,
the current code computes the bogus transformation "%lu" -> "%u".
Fix this.

Besides that, the transformation is only required on systems
that don't use 64 bits for long integers natively.

Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@...mens.com>
---
 parse-events.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/parse-events.c b/parse-events.c
index f8ba6a5..5214771 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -3789,14 +3789,15 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
 						break;
 					}
 				}
-				if (pevent->long_size == 8 && ls) {
+				if (pevent->long_size == 8 && ls &&
+				    sizeof(long) != 8) {
 					char *p;
 
 					ls = 2;
 					/* make %l into %ll */
 					p = strchr(format, 'l');
 					if (p)
-						memmove(p, p+1, strlen(p)+1);
+						memmove(p+1, p, strlen(p)+1);
 					else if (strcmp(format, "%p") == 0)
 						strcpy(format, "0x%llx");
 				}
-- 
1.7.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ