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:   Mon, 5 Jul 2021 11:01:44 +0200
From:   Marco Elver <elver@...gle.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Alexander Potapenko <glider@...gle.com>,
        Dmitry Vyukov <dvyukov@...gle.com>, pcc@...gle.com,
        Catalin Marinas <catalin.marinas@....com>,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-mm <linux-mm@...ck.org>,
        kasan-dev <kasan-dev@...glegroups.com>,
        Andrey Ryabinin <ryabinin.a.a@...il.com>,
        Andrey Konovalov <andreyknvl@...il.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH] kasan: fix build by including kernel.h

On Mon, 5 Jul 2021 at 10:50, Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> On Mon, Jul 5, 2021 at 10:28 AM Marco Elver <elver@...gle.com> wrote:
> > The <linux/kasan.h> header relies on _RET_IP_ being defined, and had
> > been receiving that definition via inclusion of bug.h which includes
> > kernel.h. However, since f39650de687e that is no longer the case and get
> > the following build error when building CONFIG_KASAN_HW_TAGS on arm64:
> >
> >   In file included from arch/arm64/mm/kasan_init.c:10:
> >   ./include/linux/kasan.h: In function 'kasan_slab_free':
> >   ./include/linux/kasan.h:230:39: error: '_RET_IP_' undeclared (first use in this function)
> >     230 |   return __kasan_slab_free(s, object, _RET_IP_, init);
> >
> > Fix it by including kernel.h from kasan.h.
>
> ...which I would like to avoid in the long term, but for now it's
> probably the best quick fix, otherwise it will require the real split
> of _RET_IP or at least rethinking its location.
>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.org>
> Thanks!

Thanks!

> > Fixes: f39650de687e ("kernel.h: split out panic and oops helpers")
>
> P.S. I have tested the initial patch against full build of x86_64, and
> it was long time available for different CIs/build bots, none
> complained so far.

It only manifests on arm64 when using CONFIG_KASAN_HW_TAGS mode
(requires Arm64 MTE extensions). The other 2 modes include
<linux/pgtable.h> in kasan.h, and that seems to include kernel.h
somewhere. The HW_TAGS mode, however, doesn't receive -next testing by
a CI system AFAIK, so this was missed because it's not yet used by
many (I'd expect that to change when CPUs with MTE are more
widespread).

Thanks,
-- Marco

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ