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]
Date:   Thu, 21 Jul 2022 14:45:25 +0200
From:   Jiri Olsa <olsajiri@...il.com>
To:     Xu Kuohai <xukuohai@...weicloud.com>,
        Jean-Philippe Brucker <jean-philippe@...aro.org>
Cc:     bpf@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, Alexei Starovoitov <ast@...nel.org>,
        Andrii Nakryiko <andrii@...nel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Hao Luo <haoluo@...gle.com>,
        Jakub Sitnicki <jakub@...udflare.com>,
        John Fastabend <john.fastabend@...il.com>,
        Jon Hunter <jonathanh@...dia.com>,
        KP Singh <kpsingh@...nel.org>,
        Martin KaFai Lau <martin.lau@...ux.dev>,
        Song Liu <song@...nel.org>,
        Stanislav Fomichev <sdf@...gle.com>,
        Will Deacon <will@...nel.org>, Yonghong Song <yhs@...com>,
        Zi Shen Lim <zlim.lnx@...il.com>
Subject: Re: [PATCH bpf-next] bpf, arm64: Fix compile error in dummy_tramp()

On Thu, Jul 21, 2022 at 08:13:19AM -0400, Xu Kuohai wrote:
> From: Xu Kuohai <xukuohai@...wei.com>
> 
> dummy_tramp() uses "lr" to refer to the x30 register, but some assembler
> does not recognize "lr" and reports a build failure:
> 
> /tmp/cc52xO0c.s: Assembler messages:
> /tmp/cc52xO0c.s:8: Error: operand 1 should be an integer register -- `mov lr,x9'
> /tmp/cc52xO0c.s:7: Error: undefined symbol lr used as an immediate value
> make[2]: *** [scripts/Makefile.build:250: arch/arm64/net/bpf_jit_comp.o] Error 1
> make[1]: *** [scripts/Makefile.build:525: arch/arm64/net] Error 2
> 
> So replace "lr" with "x30" to fix it.
> 
> Fixes: b2ad54e1533e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64")
> Reported-by: Jon Hunter <jonathanh@...dia.com>
> Tested-by: Jon Hunter <jonathanh@...dia.com>
> Signed-off-by: Xu Kuohai <xukuohai@...wei.com>

Jean-Philippe, could you please take a look?

thanks,
jirka

> ---
>  arch/arm64/net/bpf_jit_comp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
> index dcc572b7d4da..7ca8779ae34f 100644
> --- a/arch/arm64/net/bpf_jit_comp.c
> +++ b/arch/arm64/net/bpf_jit_comp.c
> @@ -610,8 +610,8 @@ asm (
>  #if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL)
>  "	bti j\n" /* dummy_tramp is called via "br x10" */
>  #endif
> -"	mov x10, lr\n"
> -"	mov lr, x9\n"
> +"	mov x10, x30\n"
> +"	mov x30, x9\n"
>  "	ret x10\n"
>  "	.size dummy_tramp, .-dummy_tramp\n"
>  "	.popsection\n"
> -- 
> 2.30.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ