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: <20180429232031.5p2y4s274inymf4b@ast-mbp>
Date:   Sun, 29 Apr 2018 16:20:33 -0700
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Yonghong Song <yhs@...com>
Cc:     ast@...com, daniel@...earbox.net, netdev@...r.kernel.org,
        kernel-team@...com
Subject: Re: [PATCH bpf-next] samples/bpf: fix kprobe attachment issue on x64

On Sun, Apr 29, 2018 at 03:06:31PM -0700, Yonghong Song wrote:
> Commit d5a00528b58c ("syscalls/core, syscalls/x86: Rename
> struct pt_regs-based sys_*() to __x64_sys_*()") renamed a lot
> of syscall function sys_*() to __x64_sys_*().
> This caused several kprobe based samples/bpf tests failing.
> 
> This patch fixed the problem by using __x64_sys_*(),
> instead of sys_*(), in bpf program SEC annotations if
> the target arch is __TARGET_ARCH_x86.
> 
> Fixes: d5a00528b58c ("syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()")
> Signed-off-by: Yonghong Song <yhs@...com>
> ---
>  samples/bpf/map_perf_test_kern.c                  | 32 +++++++++++++++++++++++
>  samples/bpf/test_current_task_under_cgroup_kern.c |  4 +++
>  samples/bpf/test_map_in_map_kern.c                |  4 +++
>  samples/bpf/test_probe_write_user_kern.c          |  4 +++
>  samples/bpf/trace_output_kern.c                   |  4 +++
>  samples/bpf/tracex2_kern.c                        |  4 +++
>  6 files changed, 52 insertions(+)
> 
> diff --git a/samples/bpf/map_perf_test_kern.c b/samples/bpf/map_perf_test_kern.c
> index 2b2ffb9..79f4320 100644
> --- a/samples/bpf/map_perf_test_kern.c
> +++ b/samples/bpf/map_perf_test_kern.c
> @@ -95,7 +95,11 @@ struct bpf_map_def SEC("maps") lru_hash_lookup_map = {
>  	.max_entries = MAX_ENTRIES,
>  };
>  
> +#ifdef __TARGET_ARCH_x86
> +SEC("kprobe/__x64_sys_getuid")
> +#else
>  SEC("kprobe/sys_getuid")
> +#endif

I think it would be better to hack bpf_load.c to add __x64_
automatically when it matches "sys_" in the beginning of kprobe name.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ