From patchwork Wed Mar 9 09:01:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brown X-Patchwork-Id: 8544141 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B85DF9F46A for ; Wed, 9 Mar 2016 09:01:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C16620251 for ; Wed, 9 Mar 2016 09:01:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A97182014A for ; Wed, 9 Mar 2016 09:01:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752524AbcCIJBU (ORCPT ); Wed, 9 Mar 2016 04:01:20 -0500 Received: from mail-pf0-f182.google.com ([209.85.192.182]:34362 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752214AbcCIJBT (ORCPT ); Wed, 9 Mar 2016 04:01:19 -0500 Received: by mail-pf0-f182.google.com with SMTP id 129so35274269pfw.1 for ; Wed, 09 Mar 2016 01:01:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AJxBO6Kdqzzkthv93UaPcZxqNOLwcnUS0sm1MMgeOkY=; b=Gd3RRCqSCTY9rwwi9ae8s1KeKWlgA8K4mKnUqIMNSWnGUUEzmV2aPb0jC9REIp2PuQ NqiY9deobwWhJwR+wJMS1h/sEKO7pcFdcQFI/9T3+tGbAaBYDRg49InNYEzrxBCPGO+X 5cIHQEMeT6Nlj+aLds2WLvrnfS7iNwwaTr/6A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=AJxBO6Kdqzzkthv93UaPcZxqNOLwcnUS0sm1MMgeOkY=; b=TxgsbM6YLcp1731xgH1x87wWGQnIQv/bHoS0bppG8W7qxvlmZwbFy0Ex9CeEAQWTPZ XHxUHeS7Cw0MyjaYjuhqs8z+Q1N3mT2vs1rpJvPgeY5RBGMQX+6j79oyNMJKLFuiCIxL 3h76BML2z0ysU0ue+PZE12474TvGzml90V62Hdl4BvwErtkREMvVg7kmP/SFzU48U2Ii 2uctW5CtSspottFHUT5c4p9vNYy0g6SDyVN6Qhy9lKCB1d7fIFIEF1opoq43zimXYLQO VaVl3Y4Bu0q4TF/sF5BQLIIKDX3waHYB3UvZbX+pSqzJsYNPTA5J5ftByS1entfioQ1l tS/w== X-Gm-Message-State: AD7BkJI5PDtzObaXk8OqpF5iaP/SZqlblfeMbPxeX5DsC7F8qfTx7DE31wWXkpTFHtP9a3dJ X-Received: by 10.98.13.88 with SMTP id v85mr26220893pfi.150.1457514078549; Wed, 09 Mar 2016 01:01:18 -0800 (PST) Received: from davidb.org ([172.97.103.101]) by smtp.gmail.com with ESMTPSA id vy6sm10581501pac.38.2016.03.09.01.01.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Mar 2016 01:01:18 -0800 (PST) Date: Wed, 9 Mar 2016 02:01:15 -0700 From: David Brown To: Emese Revfy Cc: kernel-hardening@lists.openwall.com, linux-kbuild@vger.kernel.org, pageexec@freemail.hu, spender@grsecurity.net, mmarek@suse.com, keescook@chromium.org, linux@rasmusvillemoes.dk, fengguang.wu@intel.com, dvyukov@google.com, linux-kernel@vger.kernel.org Subject: Re: [kernel-hardening] [PATCH v5 2/5] GCC plugin infrastructure Message-ID: <20160309090115.GA6964@davidb.org> References: <20160307000208.1bec3e7dc874489d1b4fcbb4@gmail.com> <20160307000427.c82f18670568e1e656fc9532@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160307000427.c82f18670568e1e656fc9532@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Mar 07, 2016 at 12:04:27AM +0100, Emese Revfy wrote: >This patch allows to build the whole kernel with GCC plugins. It was ported from >grsecurity/PaX. The infrastructure supports building out-of-tree modules and >building in a separate directory. Cross-compilation is supported too but >currently only the x86 architecture enables plugins. I've tested this with both ARM and ARM64. There are some missing headers in the arm64 gcc, reported here: https://bugs.linaro.org/show_bug.cgi?id=2123 (also upstream), but this should work once that is fixed. Feel free to fold these into your patch, or, if you prefer, I can send out separate patches for them. Signed-off-by: David Brown diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 4f799e5..67ee8e3 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -54,6 +54,7 @@ config ARM select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL) select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) select HAVE_GENERIC_DMA_COHERENT + select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)) select HAVE_IDE if PCI || ISA || PCMCIA select HAVE_IRQ_TIME_ACCOUNTING diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 8cc6228..6d6e4f8 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -70,6 +70,7 @@ config ARM64 select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_GRAPH_TRACER + select HAVE_GCC_PLUGINS select HAVE_GENERIC_DMA_COHERENT select HAVE_HW_BREAKPOINT if PERF_EVENTS select HAVE_IRQ_TIME_ACCOUNTING