From patchwork Thu Jan 11 02:03:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10156529 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 9A6B9605BA for ; Thu, 11 Jan 2018 02:08:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A47E28715 for ; Thu, 11 Jan 2018 02:08:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DE6828716; Thu, 11 Jan 2018 02:08:23 +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 89F3428712 for ; Thu, 11 Jan 2018 02:08:22 +0000 (UTC) Received: (qmail 31795 invoked by uid 550); 11 Jan 2018 02:04:05 -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 30287 invoked from network); 11 Jan 2018 02:03:48 -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=7xfHfVUjFIj7TupED5lWUwNqXxqh/MUqfoqT4XIi7K4=; b=keW/NYMCdqwbmqVX37Iam/L3jaU5oUn9dANY+YkZJcm60BrTkLBFu4iM5EnQSxdsda /fEKVWG/ngse/QMVao0LJ2//hgx9CpaYdG8ykfrxPAmD+OXKAHsb0S9lcVk1CSN0VRIC bcrRpRF3qM8HtkwmLIftJAJvizYkdqurCi3Jw= 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=7xfHfVUjFIj7TupED5lWUwNqXxqh/MUqfoqT4XIi7K4=; b=If0IzVijEp5Aa/PoPf9YeWalQUlZw48yGZ9wdyY0JjPLNFlN3Y3XXuMtCHK6GqO/9M bZgpO5BlmB1xhX7r+sYFfeD2oqHjtli+vnccbvpou86zpcS1Ynb6jXu+avnIVui0uc+M f3ZCLDGNCHaG+VPFemA7iTdE1hhMJHE0lMQ2U59MiOa1dVxbFP2YpHTIiODiqchFZdpg 16jrDbw2WL9xoPZdxAsH2gDNuYc5Ei4rcMgR6Bf+bS0+/TbJJ7hSNH86BOXYDc9xCwAz o8q6LG61zEbgJPLnJGTMMkSiygNyHP5ZC/NQeXb1oLVCQjJ9FdirVwnJA53EkE3Bc0ny js9w== X-Gm-Message-State: AKGB3mIaX2xq8djahjpJ3dkcf0sYr1+gjtD4vqb90sSrA0kmA1cnEZgA 5CG0nmMxtegbWWGD6h4t1LTshA== X-Google-Smtp-Source: ACJfBot0B7YaBJrK0JZO8fg2sGHmV81RgRz7RooG0LavGA/ra2ttdmHioMsqUs5F1XS1bczyJKM3Jg== X-Received: by 10.98.16.132 with SMTP id 4mr11403014pfq.42.1515636216533; Wed, 10 Jan 2018 18:03:36 -0800 (PST) From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Kees Cook , Russell King , Ingo Molnar , Christian Borntraeger , "Peter Zijlstra (Intel)" , linux-arm-kernel@lists.infradead.org, Linus Torvalds , David Windsor , Alexander Viro , Andrew Morton , Andy Lutomirski , Christoph Hellwig , Christoph Lameter , "David S. Miller" , Laura Abbott , Mark Rutland , "Martin K. Petersen" , Paolo Bonzini , Christoffer Dall , Dave Kleikamp , Jan Kara , Luis de Bethencourt , Marc Zyngier , Rik van Riel , Matthew Garrett , linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org, kernel-hardening@lists.openwall.com Date: Wed, 10 Jan 2018 18:03:06 -0800 Message-Id: <1515636190-24061-35-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515636190-24061-1-git-send-email-keescook@chromium.org> References: <1515636190-24061-1-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] [PATCH 34/38] arm: Implement thread_struct whitelist for hardened usercopy X-Virus-Scanned: ClamAV using ClamSMTP ARM does not carry FPU state in the thread structure, so it can declare no usercopy whitelist at all. Cc: Russell King Cc: Ingo Molnar Cc: Christian Borntraeger Cc: "Peter Zijlstra (Intel)" Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook --- arch/arm/Kconfig | 1 + arch/arm/include/asm/processor.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 51c8df561077..3ea00d65f35d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -50,6 +50,7 @@ config ARM select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU select HAVE_ARCH_MMAP_RND_BITS if MMU select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) + select HAVE_ARCH_THREAD_STRUCT_WHITELIST select HAVE_ARCH_TRACEHOOK select HAVE_ARM_SMCCC if CPU_V7 select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h index 338cbe0a18ef..01a41be58d43 100644 --- a/arch/arm/include/asm/processor.h +++ b/arch/arm/include/asm/processor.h @@ -45,6 +45,13 @@ struct thread_struct { struct debug_info debug; }; +/* Nothing needs to be usercopy-whitelisted from thread_struct. */ +static inline void arch_thread_struct_whitelist(unsigned long *offset, + unsigned long *size) +{ + *offset = *size = 0; +} + #define INIT_THREAD { } #define start_thread(regs,pc,sp) \