linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Marco Elver <elver@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrey Konovalov <andreyknvl@google.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Kees Cook <keescook@chromium.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	"ndesaulniers@google.com" <ndesaulniers@google.com>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/kasan: fix kasan_check_read() compiler warning
Date: Tue, 9 Jul 2019 21:35:34 +0200	[thread overview]
Message-ID: <CAK8P3a1SQaEymLpvTaX0_YDsGcKt=ys6_KwceC7mpkFJzhpQ=g@mail.gmail.com> (raw)
In-Reply-To: <CANpmjNNiygcPkXSFWGNZtOf6LC1Z_xjnim=4hH_KMDEZ9SodDg@mail.gmail.com>

On Tue, Jul 9, 2019 at 8:46 PM Marco Elver <elver@google.com> wrote:
>
> On Tue, 9 Jul 2019 at 20:36, Arnd Bergmann <arnd@arndb.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

  reply	other threads:[~2019-07-09 19:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09 18:35 [PATCH] mm/kasan: fix kasan_check_read() compiler warning Arnd Bergmann
2019-07-09 18:46 ` Marco Elver
2019-07-09 19:35   ` Arnd Bergmann [this message]
2019-07-09 18:51 ` Nick Desaulniers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK8P3a1SQaEymLpvTaX0_YDsGcKt=ys6_KwceC7mpkFJzhpQ=g@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=cl@linux.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mingo@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).