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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H4nuwBJHE3VPj6yE2HUw3tDaLtgeRQ5mj0SRV6RoD8-9Q@mail.gmail.com>
Date:   Thu, 13 Jul 2023 12:33:33 +0800
From:   Huacai Chen <chenhuacai@...nel.org>
To:     Andrey Konovalov <andreyknvl@...il.com>
Cc:     Huacai Chen <chenhuacai@...ngson.cn>,
        Marco Elver <elver@...gle.com>,
        Andrey Ryabinin <ryabinin.a.a@...il.com>,
        Alexander Potapenko <glider@...gle.com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        kasan-dev@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kasan: Fix tests by removing -ffreestanding

Hi, Andrey,

On Thu, Jul 13, 2023 at 12:12 AM Andrey Konovalov <andreyknvl@...il.com> wrote:
>
> On Wed, Jul 12, 2023 at 12:14 PM Huacai Chen <chenhuacai@...ngson.cn> wrote:
> >
> > CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX hopes -fbuiltin for memset()/
> > memcpy()/memmove() if instrumentation is needed. This is the default
> > behavior but some archs pass -ffreestanding which implies -fno-builtin,
> > and then causes some kasan tests fail. So we remove -ffreestanding for
> > kasan tests.
>
> Could you clarify on which architecture you observed tests failures?
Observed on LoongArch [1], KASAN for LoongArch was planned to be
merged in 6.5, but at the last minute I found some tests fail with
GCC14 (CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX) so the patches are
dropped. After some debugging we found the root cause is
-ffreestanding.

[1] https://github.com/chenhuacai/linux/commit/af2da91541a8899b502bece9b1fde225b71f37a8

Huacai
>
> >
> > Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
> > ---
> >  mm/kasan/Makefile | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/mm/kasan/Makefile b/mm/kasan/Makefile
> > index 7634dd2a6128..edd1977a6b88 100644
> > --- a/mm/kasan/Makefile
> > +++ b/mm/kasan/Makefile
> > @@ -45,7 +45,9 @@ CFLAGS_KASAN_TEST += -fno-builtin
> >  endif
> >
> >  CFLAGS_kasan_test.o := $(CFLAGS_KASAN_TEST)
> > +CFLAGS_REMOVE_kasan_test.o := -ffreestanding
> >  CFLAGS_kasan_test_module.o := $(CFLAGS_KASAN_TEST)
> > +CFLAGS_REMOVE_kasan_test_module.o := -ffreestanding
> >
> >  obj-y := common.o report.o
> >  obj-$(CONFIG_KASAN_GENERIC) += init.o generic.o report_generic.o shadow.o quarantine.o
> > --
> > 2.39.3
>
> +Marco

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ