From patchwork Tue Jul 9 18:35:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 168765 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8900951ilk; Tue, 9 Jul 2019 11:37:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8z7IXChW7quP+fXLxX5CXFe2lOuRbq7Q5c9zggmQ1Ef8fT1yZegR82Xy7k6GqI6Uy54i+ X-Received: by 2002:a17:902:29e6:: with SMTP id h93mr32353210plb.297.1562697433017; Tue, 09 Jul 2019 11:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562697433; cv=none; d=google.com; s=arc-20160816; b=dyaFA4h/8hs0aj2wGkjIv0XncJC0RZpTGQhQu0F0ffTEgJj5FjDwA5SFIX7i5vYeEc by5/PmdRMqyVkr3H8xNUvtuY/DNcboeCS1aEA8YnE2KEGJ+OvimjUxsAesbSP6JyBj0T PXtIZ6InWjMG6zFwnpcVwGIh0yVPUsZfMbMQjYFp0AzBXEse47aRjQd/bnOlGJLolAlB 0Brtpyp0zlv2Kz0wdsPv+4X4UG29ek6Yv0yYxT460kCskEUU9OdGMv8JxjLClukImrbP 21G7mqKHCpqTT6K1pxEKI+1iYh81jydn8P0B/N8HIn+uEYsUOJv4vvx11ML1RuRJw9RL bwZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HP2E+3u0/A0ZI0NkRxW/cV2L+0cskb/ULUiULD193HI=; b=iuR2noTXsyBf+syOWqPSpEUIj63zjms2vYdIPjpLgeIGKQjznAXkSPt6hLVEafN+SX es5UsxB1iII4D6U94PEU4eoXW5nee2JVBUekxt3W+GW+0JnNNulKoaK6HrZwfTGag15q ox3+QIEMQ1gC3N0qZlFKFtUT4aKOYffRr8o96VgLAav/f3lRYmsm1tgzSXnfxybsOvx1 2MZ1ZHT5//FEPm19k9yTgcS+5XDFSL2oDUcugDqGpMaRjA2JTmyqST4+ulbLomAG/aaF 8oT4nlv+E8wRSqo9FC8P8F5F76NCcI6z4I32MF/o0jgOKuIeMvBXoYKKnhchWIXJ8nYn SlaA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si3162354pjq.63.2019.07.09.11.37.12; Tue, 09 Jul 2019 11:37:13 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729037AbfGIShL (ORCPT + 30 others); Tue, 9 Jul 2019 14:37:11 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:35105 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727666AbfGIShL (ORCPT ); Tue, 9 Jul 2019 14:37:11 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1MmU1H-1iBULr1JYX-00iS69; Tue, 09 Jul 2019 20:36:26 +0200 From: Arnd Bergmann To: Andrew Morton Cc: Arnd Bergmann , Marco Elver , 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 , linux-kernel@vger.kernel.org Subject: [PATCH] mm/kasan: fix kasan_check_read() compiler warning Date: Tue, 9 Jul 2019 20:35:40 +0200 Message-Id: <20190709183612.2693974-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:f9tLUWPoDVBA60LLEiX/NkMOqicieII3W/k/YIGKz7X2J9Lxb/h 5riQyTf13phU14Nz5hQgZ+cFzoe84RnrWqOLP1PaXV1ZX4N5wC+wyB/+hrwnd5Ae7LeSZTA qhKdUB2jwKoIzuYwqlMcKX4C0H4tMxU76bpQTDI1UXvHOgcvWRuj1rgceDPbyGmT8DntxUn 0o8CKBHmZ1d6Qw7SZg74g== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:IH6JMBtZ3W8=:d8iGHkyJLAZyJgAL5R+EKT wDHfL0miZNRPQrzvx9brg+EoYFDH+5liuU0k4GN8LTfX/WTZKJaiZyUcIm0V+Sgfwm0aIy49o yYAmWZdWGzJoPr2dILKw7YGqBILQxrbVqsn9KwipJSRvhzp9ke7mYQ9gyUd+Gqg6SyXa2p8qm oGeJUyScwk5YwWrnwQCNoBIcR2FKsn8Ws3Ea0gLruUbcuzySPux2m3g3NXMTokg2vQvky/msP f2Hg9KtBBeAt90bphBX0p5ogo7fXNrxTV/2W5EVfVaRfkNEL5nTEMnLVlyNEf1j31PH9Kbbd0 IhbpmSigld2AQXAzmXl1DVfN9WDRzMwO5zVtqhin9FFImc7Q1mcvY1Ny3ZMIP1v0WALDOK2OY g6+0K9tWyYtBNz0sPgle8UL7oBGJksGCrNBHZw1iywlAjRdoSvqTrFTA9bppTgC/5Jhr8wUjt 1PcHSxOY8rgE3AIRlXe/9+p1DbG/+XdA26x+n3l+xWxmNEbZtFBje9TN/aqE47mWlNP6ScnQd rhXQXh/P22dEdovRNYJSkbroGE9Fd7a3blYvQk2DBhc4n/ONGxz1UW/xyVYyVqLG2L2GKW3dS HBNLxoYMdca0CIDY/2CdJTHu/P/hoQ0KkAIKilsNjhZkVcpiUa29XeCJ+xVlm6i8hAr3FPXSt V2cOqL9+xIg5B6W3ErQwOiOLWeuTwLJUFEYDwzQTYq/gTNpE0Gty/M2WkHH1YZelrCl7XLhvS v/9SZ8DBn0EGEfs3U7sLn2fDmMWbLwtHBhaZFQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.0 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; }