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: <mhng-b17acfa9-03e8-4ef7-a24f-a133b2dbf31a@palmer-ri-x1c9>
Date: Tue, 17 Sep 2024 08:41:05 -0700 (PDT)
From: Palmer Dabbelt <palmer@...belt.com>
To: alexghiti@...osinc.com
CC: vladimir.isaev@...tacore.com, roman.artemev@...tacore.com, guoren@...nel.org,
  Paul Walmsley <paul.walmsley@...ive.com>, aou@...s.berkeley.edu, linux-riscv@...ts.infradead.org,
  linux-kernel@...r.kernel.org, alexghiti@...osinc.com
Subject:     Re: [PATCH v2 1/2] riscv: vdso: Prevent gcc from inserting calls to memset()

On Thu, 04 Jul 2024 23:09:01 PDT (-0700), 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.

This option doesn't exist on LLVM (at least on whatever version I'm 
using), and I'm not getting any memset()s generated locally so I'm not 
sure what to look for over there.

>From poking around GCC it looks like we might want -fno-tree-ccp too?  
That seems to be able to convert assignments into builtins as well...

> 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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ