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-next>] [day] [month] [year] [list]
Message-Id: <20190709183612.2693974-1-arnd@arndb.de>
Date:   Tue,  9 Jul 2019 20:35:40 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Arnd Bergmann <arnd@...db.de>, Marco Elver <elver@...gle.com>,
        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>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] mm/kasan: fix kasan_check_read() compiler warning

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.

Fixes: dc55b51f312c ("mm/kasan: introduce __kasan_check_{read,write}")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ