Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8258248ybi; Tue, 9 Jul 2019 12:07:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwszvQphIBL719A0zczCE8EhTI2ovg/w/2/Vmg14+qQLiUDS/reUDvV2cgFIJ9pk9FLgAMp X-Received: by 2002:a63:2006:: with SMTP id g6mr31758101pgg.287.1562699243582; Tue, 09 Jul 2019 12:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562699243; cv=none; d=google.com; s=arc-20160816; b=i41Qy652vXewmBosbqHCEhEYh/CsFP83LmN/jfo6Ihp8TtxkvMqg/emJ+6uUdVEO3H AXOveztGP91ynRe2+qDkD6Dnzh736Hbvry3+4D5GgNRO/zdoT7JBy1nT53B6zKeXEqjm Wz3AY66nF5rPuXkPRQBcFragPDLEjA1HaI5pgZ/KFYZfc4oTnMa/nototMBpHiQ+wY3R hoKtt1B+dmlw7zqZqNL1kODfmegmLwrsWGsh/CCyki1pJJBAj20totc+HS9q/Kb6JjEr fLQSKRlu1IqTUDtmvvnrZVuPrOq6FrhfwBLUW0mrCdWRB8Pdgo+jRyholZZOax7xkGvX e5SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mPb3oFVH7SXAIMMb5SqF2LANi5F8/gGzo3aFgFykbQ0=; b=C4N93CY6Rb2l6JP8pVdQ9XrFa77QwLrvlQdlBOENOCnLm+yZij+af2zlzzieuPJ0Q9 91FCallAeowwmJZ7Zf8qHVUIKwC1N1vGJ1IFjZp/bSXClgDA2DFSE8SXWqRD+g18Eq6f yuC+aNpQ9aGLn9Lv8G7omKxDjhoxqeUaQaoTm3HBk5hUhVvh4IiFjH0uXcc0CJxwwzFD qLX5q0YsSkmCxn2J754R0DEaP4SHc5EnrqDixhQORpXDWYpFiPBOVMWcMjBqxSKmT71z P/ePpCc036FBce5tGzOtMqIIHHLd1oPXUONsrmU+D6G5Wc8fXvB6XxjM0u1qIrTRvlCC Yx1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MHZpz09J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q24si15749743pls.7.2019.07.09.12.07.08; Tue, 09 Jul 2019 12:07:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MHZpz09J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729349AbfGISqd (ORCPT + 99 others); Tue, 9 Jul 2019 14:46:33 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:37982 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726592AbfGISqd (ORCPT ); Tue, 9 Jul 2019 14:46:33 -0400 Received: by mail-ot1-f67.google.com with SMTP id d17so20991907oth.5 for ; Tue, 09 Jul 2019 11:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mPb3oFVH7SXAIMMb5SqF2LANi5F8/gGzo3aFgFykbQ0=; b=MHZpz09J6MD/WjV0jxLzTdV5rfe+IWSGbMi6gj9Yuz0TZKgeLc1dHH3q519x4+Y77t Av6vMpMGQNXS9RAK2XUBdYw/czT0Vz6SyBWPH6o4TXY/CamX8fiNrNXJThPA5U7iXwtv 07bfjHpEeFiO6R6xDM1Mi829x6K/R1Sw1IUU71+/+TMgJKmH3Xp2P3xkpOamJ5WtDP8a fUh/zyRR2tc/ivQb/1N61ppfa4/bisMxjK90MCvqPudhS7d05MCj933O6IcLRTwgAQPI WIu7560aNuehe7ZmVjvwJDKqwxeLYxKj+5NC3JqQ5pl7D7F9fHZU0uxFy57jiKw9V0na 22Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mPb3oFVH7SXAIMMb5SqF2LANi5F8/gGzo3aFgFykbQ0=; b=Q96bEXahyxsQzftrJafgcxyqITGffgMZAeF2fc5xCAA8TZlNqg2xU1GsjmW4xtYlGG Aa7H0HSCCT/RTc0VFTkHDE6Bm+C5NAHt8KKuSyIpne9ptJKuwwnSEU+5eOjDR/KamVQN fhMs0zDtQf4SZVD/hhyVd2aH2QGlQ7pJ/XZ/wkdK3rd+nkYw5eLR1JlmCFWuGIVuHL15 2xT6HrOdlzMdFswYhxHBFg+OzfHUhS3GToUCcKKC0Zt5jvIBc5JOQ1WI6IRuVv5fyeez Fguz5vTSqJy2Ndsp9WrWayGEH+6WkMNV2si/XpuajtI0GGtpjC5S78lyrjrgT+YJQJLQ 6SjQ== X-Gm-Message-State: APjAAAW4x+9AfjI0G2w7NPv3+hMs6OfJnHst/FYVnOB5MgC/rFX5U1FG AZgTWfUZIvP1CwBuuGklKp7d9bxI2ydXC6BBkVxTcw== X-Received: by 2002:a05:6830:1688:: with SMTP id k8mr21121565otr.233.1562697992105; Tue, 09 Jul 2019 11:46:32 -0700 (PDT) MIME-Version: 1.0 References: <20190709183612.2693974-1-arnd@arndb.de> In-Reply-To: <20190709183612.2693974-1-arnd@arndb.de> From: Marco Elver Date: Tue, 9 Jul 2019 20:46:20 +0200 Message-ID: Subject: Re: [PATCH] mm/kasan: fix kasan_check_read() compiler warning To: Arnd Bergmann Cc: Andrew Morton , Mark Rutland , Andrey Ryabinin , Dmitry Vyukov , Alexander Potapenko , Andrey Konovalov , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Kees Cook , Stephen Rothwell , Luc Van Oostenryck , "ndesaulniers@google.com" , Miguel Ojeda , Ingo Molnar , Josh Poimboeuf , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Jul 2019 at 20:36, Arnd Bergmann 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 > > Fixes: dc55b51f312c ("mm/kasan: introduce __kasan_check_{read,write}") > Signed-off-by: Arnd Bergmann > --- > include/linux/compiler.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/compiler.h b/include/linux/compiler.h > index f0fd5636fddb..22909500ba1d 100644 > --- a/include/linux/compiler.h > +++ b/include/linux/compiler.h > @@ -277,7 +277,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s > static __no_kasan_or_inline > unsigned long read_word_at_a_time(const void *addr) > { > - kasan_check_read(addr, 1); > + __kasan_check_read(addr, 1); > return *(unsigned long *)addr; > } > > -- > 2.20.0 >