From patchwork Wed Mar 29 18:15:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9652191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B32B602C8 for ; Wed, 29 Mar 2017 18:17:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54D5D27165 for ; Wed, 29 Mar 2017 18:17:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 480DA284EF; Wed, 29 Mar 2017 18:17:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 5AE8027165 for ; Wed, 29 Mar 2017 18:17:07 +0000 (UTC) Received: (qmail 23796 invoked by uid 550); 29 Mar 2017 18:16:51 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 20408 invoked from network); 29 Mar 2017 18:16:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Qa2sg0NIH3kRUIPvy5YNgvIGEkfLTDAwHmEtXm2xrvw=; b=Gm9c2Aaa0m1BujeM0DrQZF6dS+hDvTuI+8Lj2WLq39+CDFDpBJeWVIwTzaElgq4dY3 Ee840M/iubp+RahR/MGho7j6GxQFeNUPil5LPQkR2aQmg3Zb4mXV3muenITFg9mACikZ E03f2d5PjpltxHUeKMijdnU00jUKwmqmBac/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Qa2sg0NIH3kRUIPvy5YNgvIGEkfLTDAwHmEtXm2xrvw=; b=b9QvK1JyDTP9ADzyxKj+xk9SzoCwbOZSPeWFqMapK4YJOfT3hnVQYQwgnvlJrHevSH vn3ZKucFFhfr6zTr7mF7Hf3sYNxkvwq/BgvoF+hlMR7oHJBKaID30hSeMRFaXIycaaKU XROOQ/Ce3uS35EfCX0P8acv16Uwds0+LGuSscm78pf12FudO8y2HlU4XZJsyH78f7rt6 7rML4/J6yG0gJ2KLAeCfqbJBBX53HIet3Pc93YSl8d2FjAiuX9clDIdRKwb04CDbTnWU UjwuavoTBhjWtNKGW/sIsc1TwZE1runy9ERTmsq2gfQEwe4Gryn3vNaHWzNS/0rHvfJz lHSw== X-Gm-Message-State: AFeK/H1bonr149HcvaoUZ8ajpeHfxWLb1uE3kkOu8x28yeMGgZ6m6OfSxmfZJNFT3tNSZAtd X-Received: by 10.84.228.194 with SMTP id y2mr2081146pli.85.1490811383847; Wed, 29 Mar 2017 11:16:23 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , Mark Rutland , Andy Lutomirski , Hoeun Ryu , PaX Team , Emese Revfy , Russell King , x86@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Wed, 29 Mar 2017 11:15:58 -0700 Message-Id: <1490811363-93944-7-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490811363-93944-1-git-send-email-keescook@chromium.org> References: <1490811363-93944-1-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] [RFC v2][PATCH 06/11] ARM: domains: Extract common USER domain init X-Virus-Scanned: ClamAV using ClamSMTP Everything but the USER domain is the same with CONFIG_CPU_SW_DOMAIN_PAN or not. This extracts the differences for a common DACR_INIT macro so it is easier to make future changes (like adding the WR_RARE domain). Signed-off-by: Kees Cook --- arch/arm/include/asm/domain.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h index 99d9f630d6b6..8b33bd7f6bf9 100644 --- a/arch/arm/include/asm/domain.h +++ b/arch/arm/include/asm/domain.h @@ -59,18 +59,18 @@ #define domain_val(dom,type) ((type) << (2 * (dom))) #ifdef CONFIG_CPU_SW_DOMAIN_PAN -#define DACR_INIT \ - (domain_val(DOMAIN_USER, DOMAIN_NOACCESS) | \ - domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ - domain_val(DOMAIN_IO, DOMAIN_CLIENT) | \ - domain_val(DOMAIN_VECTORS, DOMAIN_CLIENT)) +#define __DACR_INIT_USER \ + domain_val(DOMAIN_USER, DOMAIN_NOACCESS) #else +#define __DACR_INIT_USER \ + domain_val(DOMAIN_USER, DOMAIN_CLIENT) +#endif + #define DACR_INIT \ - (domain_val(DOMAIN_USER, DOMAIN_CLIENT) | \ + (__DACR_INIT_USER | \ domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ domain_val(DOMAIN_IO, DOMAIN_CLIENT) | \ domain_val(DOMAIN_VECTORS, DOMAIN_CLIENT)) -#endif #define __DACR_DEFAULT \ domain_val(DOMAIN_KERNEL, DOMAIN_CLIENT) | \