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]
Message-ID: <CAJF2gTRJ2pPgqf0KSdk-q1w80vnVg6gPgRMw1NkQMPJJztr56A@mail.gmail.com>
Date: Wed, 10 Jul 2024 09:30:30 +0800
From: Guo Ren <guoren@...nel.org>
To: Alexandre Ghiti <alexghiti@...osinc.com>
Cc: Vladimir Isaev <vladimir.isaev@...tacore.com>, 
	Roman Artemev <roman.artemev@...tacore.com>, Paul Walmsley <paul.walmsley@...ive.com>, 
	Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>, 
	linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] riscv: vdso: Prevent gcc from inserting calls to memset()

On Fri, Jul 5, 2024 at 2:10 PM Alexandre Ghiti <alexghiti@...osinc.com> wrote:
>
> gcc is smart enough to insert a call to memset() in
> riscv_vdso_get_cpus(), which generates a dynamic relocation.
>
> So prevent gcc from doing that by using the
> -fno-tree-loop-distribute-patterns option.
Good catch. I think we could put a comment on
"-fno-tree-loop-distribute-patterns". eg: Perform loop distribution of
patterns that can be code generated with calls to a library.

Others, LGTM!

Reviewed-by: Guo Ren <guoren@...nel.org>

>
> Signed-off-by: Alexandre Ghiti <alexghiti@...osinc.com>
> ---
>  arch/riscv/kernel/vdso/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
> index f7ef8ad9b550..c7e40bf36371 100644
> --- a/arch/riscv/kernel/vdso/Makefile
> +++ b/arch/riscv/kernel/vdso/Makefile
> @@ -18,6 +18,7 @@ obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
>
>  ccflags-y := -fno-stack-protector
>  ccflags-y += -DDISABLE_BRANCH_PROFILING
> +ccflags-y += -fno-tree-loop-distribute-patterns
>
>  ifneq ($(c-gettimeofday-y),)
>    CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
> --
> 2.39.2
>


-- 
Best Regards
 Guo Ren

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ