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>] [day] [month] [year] [list]
Message-ID: <20170812134901.30237-1-wangnan0@huawei.com>
Date:   Sat, 12 Aug 2017 13:49:01 +0000
From:   Wang Nan <wangnan0@...wei.com>
To:     <acme@...nel.org>, <tmricht@...ux.vnet.ibm.com>
CC:     <linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        "Wang Nan" <wangnan0@...wei.com>,
        Alexei Starovoitov <alexei.starovoitov@...il.com>,
        Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>,
        Li Zefan <lizefan@...wei.com>
Subject: [PATCH] perf test llvm: Fix f_mode endianness problem

Perf BPF prologue generator unconditionally fetches 8 bytes for function
parameters. On big endian machine, a casting is resquired if the parameter
is not u64.

Signed-off-by: Wang Nan <wangnan0@...wei.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Thomas Richter <tmricht@...ux.vnet.ibm.com>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>
Cc: Li Zefan <lizefan@...wei.com>
---
 tools/perf/tests/bpf-script-test-prologue.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/bpf-script-test-prologue.c b/tools/perf/tests/bpf-script-test-prologue.c
index b4ebc75..43f1e16 100644
--- a/tools/perf/tests/bpf-script-test-prologue.c
+++ b/tools/perf/tests/bpf-script-test-prologue.c
@@ -26,9 +26,11 @@ static void (*bpf_trace_printk)(const char *fmt, int fmt_size, ...) =
 	(void *) 6;
 
 SEC("func=null_lseek file->f_mode offset orig")
-int bpf_func__null_lseek(void *ctx, int err, unsigned long f_mode,
+int bpf_func__null_lseek(void *ctx, int err, unsigned long _f_mode,
 			 unsigned long offset, unsigned long orig)
 {
+	fmode_t f_mode = (fmode_t)_f_mode;
+
 	if (err)
 		return 0;
 	if (f_mode & FMODE_WRITE)
-- 
2.10.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ