[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a1SQaEymLpvTaX0_YDsGcKt=ys6_KwceC7mpkFJzhpQ=g@mail.gmail.com>
Date: Tue, 9 Jul 2019 21:35:34 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Marco Elver <elver@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Mark Rutland <mark.rutland@....com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Alexander Potapenko <glider@...gle.com>,
Andrey Konovalov <andreyknvl@...gle.com>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Kees Cook <keescook@...omium.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
"ndesaulniers@...gle.com" <ndesaulniers@...gle.com>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/kasan: fix kasan_check_read() compiler warning
On Tue, Jul 9, 2019 at 8:46 PM Marco Elver <elver@...gle.com> wrote:
>
> On Tue, 9 Jul 2019 at 20:36, Arnd Bergmann <arnd@...db.de> wrote:
> >
> > The kasan_check_read() is marked 'inline', which usually includes
> > the 'always_inline' attribute. In some configuration, gcc decides that
> > it cannot inline this, causing a build failure:
> >
> > In file included from include/linux/compiler.h:257,
> > from arch/x86/include/asm/current.h:5,
> > from include/linux/sched.h:12,
> > from include/linux/ratelimit.h:6,
> > from fs/dcache.c:18:
> > include/linux/compiler.h: In function 'read_word_at_a_time':
> > include/linux/kasan-checks.h:31:20: error: inlining failed in call to always_inline 'kasan_check_read': function attribute mismatch
> > static inline bool kasan_check_read(const volatile void *p, unsigned int size)
> > ^~~~~~~~~~~~~~~~
> > In file included from arch/x86/include/asm/current.h:5,
> > from include/linux/sched.h:12,
> > from include/linux/ratelimit.h:6,
> > from fs/dcache.c:18:
> > include/linux/compiler.h:280:2: note: called from here
> > kasan_check_read(addr, 1);
> > ^~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > While I have no idea why it does this, but changing the call to the
> > internal __kasan_check_read() fixes the issue.
>
> Thanks, this was fixed more generally in v5:
> http://lkml.kernel.org/r/20190708170706.174189-1-elver@google.com
Ok, that looks like a better solution indeed. I tried something
similar at first but got it wrong.
Arnd
Powered by blists - more mailing lists