Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2253697imu; Fri, 14 Dec 2018 08:08:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/VeizrThl7GsA7QQ06EnTRkNesjElA8IOS8ObRD7jsDC4+qh3TeJGAfKQSwsmGWqmnPRDUu X-Received: by 2002:a63:1321:: with SMTP id i33mr3284431pgl.380.1544803724176; Fri, 14 Dec 2018 08:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544803724; cv=none; d=google.com; s=arc-20160816; b=nTc8bn0BAntrEnuOZqh7NRnHZoplevUCkOJLk99080B+HTjVJlhA9SBnwbB6/PO2eo OUmISnmCX9FiMUwk0nohDlshfO6l/ZUoUcuGDi4EdJfO403ONvq4sb1RTjZk2k4cMz/X etMfzyWKdOeyyWibl2MdpzHL95xiVs/hZOsU7Ak7mG5rpR5c1YVNpSbq/r+KEQPNfB9k yuZQlQzYVzcj/lTkkMVFGI7J+8IdjMelLdqet+NDA+ytKRJep8PD1ZEButUBW5FeWvLG AnREsqJzZPfxOVkz1ogd8Vb4eFrfORGVcgIrx3TJlB0nkSCuXGJNQijtmarblUttAkUF 0qhQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=05ieWldMSqeN0D5nXOs4ozu5igEBSH1ZRimi7wd8+/0=; b=SNnqX1FSn73MEdT0MOQBqNNlX4JgQDQ5hl60eSDa93b1DeEI6nI5bXxVUT8sFW2gDi 4YW699OHbuo9DjhD5qrSUE9Y/yZLCcanEsTNj8M25Ov+WvL2sRXVenyBjuN8raAq7LRN Ud0p4U2PWfFgCayJDaeRVEUEg10dJjOpdyZy8ty7gW4Q7pyJaX+iXIuqZTiRYiLVt65r bMT8EYDBgM4F7sifjyJE6wBF3jWOgTufEJojtF21KpN3+JhPMs/JMsH7zg+ydk+ZAXBn ND5zH3mXXQIZUDNv3/8+7af1wfhwvpgzRHAAHDRwA1NAGQGcQvSxJQ/59E2NyB4/d9qk 0+tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uDlTIWdY; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si4279426pgd.461.2018.12.14.08.08.14; Fri, 14 Dec 2018 08:08:44 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=uDlTIWdY; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729769AbeLNQGr (ORCPT + 99 others); Fri, 14 Dec 2018 11:06:47 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:39788 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727698AbeLNQGr (ORCPT ); Fri, 14 Dec 2018 11:06:47 -0500 Received: by mail-lf1-f65.google.com with SMTP id n18so4632036lfh.6 for ; Fri, 14 Dec 2018 08:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=05ieWldMSqeN0D5nXOs4ozu5igEBSH1ZRimi7wd8+/0=; b=uDlTIWdYS6y8gKDqILUiRoz0wZ+BiZ+FcYp9iaZS4h0jOiMITcKi7Ja2L4JOjCxPPE P/CrtusR/mmod3YMuAPIYe8X/ZY9u4pwCrXw9P5Ik9z2+LKkJX4Re6DZkD+w7jcDMLHh vliBqL/s9B8FWeJdPffX+Al03s1Y37JVMdH+ED24P1ez6KqrHSyCGh8h6Gi+jg5BWuiX WAr7S2uKoAAS/QsC8B1ru3b8++xUnwlfSGhu0xvAse34IHpXnlho3aDEpZi/TQY58WVE YXcJyyIw0U5xx1lE2P2kkywtCzu1HaVviYULvFts8FEuSsOTgop8GCz9DjT2LEIYmpTW XM+A== 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:content-transfer-encoding; bh=05ieWldMSqeN0D5nXOs4ozu5igEBSH1ZRimi7wd8+/0=; b=dpSo2yWKBhamBdBFBdPD6qbyvh0NFzmnhG7ActNwlBqZDI4mAo1boY4Rlo9MrA2h6u p9rJR4TmMRErW/Ec0pUP56Fyyuh5FOyRi9w8pARzs+2a9d39Q87MRaNj3Cza5xEFkdaZ eDAdiggg52W5q6eMmouDZUXk2iqTl+Ll/KzcKBEVlTI9ev2oDvIdaX/RMpUREdCrxfrt OaCNypuUlKcZaevWeexQx7N2nLthx4Soh9djaB+1ERU+3tsvh1BQpRKpga2c1k0mNx8A I3JmwoW4Qyiyf3VmKV5+2bnBvkmSTwQEC0K6OrUSGK3RaAzWGfMk1y7tsiYXn+zF4Vi9 VdTg== X-Gm-Message-State: AA+aEWZ1tBqa98oLyzEgp46uKlGgzhaTLusU7Dy5R7NSGu0HFPU3l0Vv pStRYCO8IZ/Zj4jIyXVlkcBAHPObXEpHco2c/2w= X-Received: by 2002:a19:f813:: with SMTP id a19mr2090370lff.67.1544803604915; Fri, 14 Dec 2018 08:06:44 -0800 (PST) MIME-Version: 1.0 References: <20181214141433.466991-1-liuxiaozhou@bytedance.com> In-Reply-To: <20181214141433.466991-1-liuxiaozhou@bytedance.com> From: Miguel Ojeda Date: Fri, 14 Dec 2018 17:06:33 +0100 Message-ID: Subject: Re: [PATCH v3] Compiler Attributes: don't pollute userspace with macro definitions To: liuxiaozhou@bytedance.com Cc: Linus Torvalds , Nick Desaulniers , Luc Van Oostenryck , Masahiro Yamada , Paul Burton , Kees Cook , Arnd Bergmann , linux-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 14, 2018 at 3:16 PM Xiaozhou Liu wr= ote: > > Macros 'inline' and '__gnu_inline' used to be defined in compiler-gcc.h, > which was (and is) included entirely in (__KERNEL__ && !__ASSEMBLY__). > Commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutual= ly > exclusive") had those macros exposed to userspace, unintentionally. > > Then commit a3f8a30f3f00 ("Compiler Attributes: use feature checks > instead of version checks") moved '__gnu_inline' back into > (__KERNEL__ && !__ASSEMBLY__) and 'inline' was left behind. Since 'inline= ' > depends on '__gnu_inline', compiling error showing "unknown type name > =E2=80=98__gnu_inline=E2=80=99" will pop up, if userspace somehow include= s > . > > Other macros like __must_check, notrace, etc. are in a similar situation. > So just move all these macros back into (__KERNEL__ && !__ASSEMBLY__). > > Note: > 1. This patch only affects what userspace sees. > 2. __must_check (when !CONFIG_ENABLE_MUST_CHECK) and noinline_for_stack > were once defined in __KERNEL__ only, but we believe that they can > be put into !__ASSEMBLY__ too. > > Acked-by: Nick Desaulniers > Signed-off-by: Xiaozhou Liu Thanks Xiaozhou, picked into compiler-attributes with a slightly modified title (since it is not about compiler attributes this time), and let's see if there is any problem with it in linux-next. Nick: I kept your Ack, even if it is a different patch. Let me know if you don't want to Ack this version. Cheers, Miguel