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] [day] [month] [year] [list]
Date:   Wed, 12 May 2021 22:56:45 +0200
From:   Daniel Borkmann <daniel@...earbox.net>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>,
        Alexei Starovoitov <ast@...nel.org>,
        Zi Shen Lim <zlim.lnx@...il.com>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>
Cc:     netdev@...r.kernel.org, bpf@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next] bpf: arm64: Replace STACK_ALIGN() with
 round_up() to align stack size

On 5/10/21 2:51 PM, Tiezhu Yang wrote:
> Use the common function round_up() directly to show the align size
> explicitly, the function STACK_ALIGN() is needless, remove it.
> 
> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
> ---
>   arch/arm64/net/bpf_jit_comp.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
> index f7b1948..81c380f 100644
> --- a/arch/arm64/net/bpf_jit_comp.c
> +++ b/arch/arm64/net/bpf_jit_comp.c
> @@ -178,9 +178,6 @@ static bool is_addsub_imm(u32 imm)
>   	return !(imm & ~0xfff) || !(imm & ~0xfff000);
>   }
>   
> -/* Stack must be multiples of 16B */
> -#define STACK_ALIGN(sz) (((sz) + 15) & ~15)
> -
>   /* Tail call offset to jump into */
>   #if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL)
>   #define PROLOGUE_OFFSET 8
> @@ -255,7 +252,7 @@ static int build_prologue(struct jit_ctx *ctx, bool ebpf_from_cbpf)
>   			emit(A64_BTI_J, ctx);
>   	}
>   
> -	ctx->stack_size = STACK_ALIGN(prog->aux->stack_depth);
> +	ctx->stack_size = round_up(prog->aux->stack_depth, 16);
>   

Applied, thanks! (I retained the comment wrt stack requirement to have it explicitly stated.)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ