From patchwork Mon Aug 28 21:35:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9926317 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 3644B60375 for ; Mon, 28 Aug 2017 21:44:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 296F028767 for ; Mon, 28 Aug 2017 21:44:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E6CA287CA; Mon, 28 Aug 2017 21:44: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 59A7528767 for ; Mon, 28 Aug 2017 21:44:06 +0000 (UTC) Received: (qmail 8173 invoked by uid 550); 28 Aug 2017 21:44:04 -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 8137 invoked from network); 28 Aug 2017 21:44:03 -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=O9xPKz20LY1tV1ER5S/OnObJf6vUSLUjoiyD6T2RSes=; b=jff2HyRRKp3Gn8+hbruLeEOs7tfJRJZMnUzDBlhoF1AcLtAguTk401aJVWb6T+ZE9x F8hiGAekHDaIogrib73YtHfs6FzfWKeG/uXR2ihGbcxgslhJ45fL5QdBV7aKIRTCI7J/ AEBEdbOAl9aS0NefYTPwPVxI6uPklTfB7RfbY= 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=O9xPKz20LY1tV1ER5S/OnObJf6vUSLUjoiyD6T2RSes=; b=CBYeC9QJGxgjGCT69BXEgb3pt6VPFxefh21a2V7PL1IFF042EsJNBIJcW5Jdaz9+Xd oBpN5s316ZHt5FSqAEaSVsYvZvNMiWgpC5A9azvtanRn4K6ZzUk82OjttQORoRp/rVfk 5dEw485msC0Dgk2V+ZjEdC2eGC0refqLUmCRL4C+fNtqmBA2u6hxQzLQxJXeeQYDm9Kx oqwazYDPPOvfPi4d0uuDBiyo+09+d2e79mqIuLPYi4saUC5lrsBYW7Tq5XQO1ZvCqHZ/ XelakHMH1QVgYX1lmiWjRvEHMPE8lzLkJoRjNorDZp9llvdPbfxmNgB3tMp95bBZkOpn YDww== X-Gm-Message-State: AHYfb5g7dJckLQCklVjlq8y0otJKvjtEzF4ajh0lD92ka4GxoKWuZCxh 87NJjgoJ/9rgomgGTmDtIg== X-Received: by 10.99.0.73 with SMTP id 70mr1816936pga.219.1503956631906; Mon, 28 Aug 2017 14:43:51 -0700 (PDT) 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, linux-mm@kvack.org, kernel-hardening@lists.openwall.com, David Windsor Date: Mon, 28 Aug 2017 14:35:10 -0700 Message-Id: <1503956111-36652-30-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503956111-36652-1-git-send-email-keescook@chromium.org> References: <1503956111-36652-1-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] [PATCH v2 29/30] 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 a208bfe367b5..3781f08d00fa 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -48,6 +48,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_CBPF_JIT diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h index c3d5fc124a05..d6dc45c92ee5 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 { } #ifdef CONFIG_MMU