From patchwork Tue Aug 28 09:08:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Thierry X-Patchwork-Id: 10578065 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 213EB14BD for ; Tue, 28 Aug 2018 09:09:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11D6F2963A for ; Tue, 28 Aug 2018 09:09:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05E6229646; Tue, 28 Aug 2018 09:09:19 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5E63B2963A for ; Tue, 28 Aug 2018 09:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=n2CR+1z1QgGfsfYnfU4hL1M6e+Ym42v9RIThZ1LySRk=; b=LP9 g20HVL9wyg3oYpwrgP8HlO0WPkGO6IndJ8YBI/deWmxj6F3iw3dkM9WTG23BPud7E3l/Oq+bYoYM0 wgGpZr8NECjXC/gNsNWELuXyDutoyEd/ii0ceDJyqKXnzQOiS3dBc6SX/CalkYkFuJK6CRsgxic7X QVo4tswoq++VL5ElaDK3nG3/wNDGioYn6CMA0gD/Lc2SJN/g/xdSP+RaCGC82D5AFuW/91Tlygu5V REgEarG8bRWrMmFuBIGtfHb0aYTcvmdE+ajYYX3HzRZNCw3SL7Tma8/hrh7ZSGnfvxOzLn1CGOr8W uj8mDfGFt8LONa8qZ3BtI385Jfjh0HA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuZzh-0000cc-Bg; Tue, 28 Aug 2018 09:09:01 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuZzb-0000Jk-Ti for linux-arm-kernel@lists.infradead.org; Tue, 28 Aug 2018 09:08:57 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0E02518A; Tue, 28 Aug 2018 02:08:44 -0700 (PDT) Received: from e112298-lin.Emea.Arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F03973F721; Tue, 28 Aug 2018 02:08:42 -0700 (PDT) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk Subject: [RESEND PATCH 0/8] ARM: spectre-v1.1 mitigations Date: Tue, 28 Aug 2018 10:08:28 +0100 Message-Id: <1535447316-32187-1-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180828_020856_008047_790CD371 X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, will.deacon@arm.com, Julien Thierry MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, Reposting this series rebased on v4.19-rc1. The series provides mitigations for spectre-v1.1. It is mostly mirroring what Russell did [1], but this time for writes to user provided addresses. * Patches 1-4 ensure user addresses used by __put_user* and __copy_to_user functions are sanitized before being used. * Patches 5-8 replace some __put_user_error calls with __copy_to_user, this both reduces the number of time address sanitizing is performed and also the number of time PAN needs to be toggled. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-July/589869.html Cheers, Julien --> Julien Thierry (8): ARM: uaccess: Prevent speculative use of the current addr_limit ARM: spectre-v1.1: force address sanitizing for __put_user*() ARM: spectre-v1,v1.1: provide helpers for address sanitization ARM: spectre-v1.1: harden __copy_to_user ARM: signal: copy registers using __copy_to_user() ARM: signal: always use __copy_to_user to save iwmmxt context ARM: vfp: use __copy_to_user() when saving VFP state ARM: oabi-compat: copy oabi events using __copy_to_user() arch/arm/include/asm/assembler.h | 10 ++++++ arch/arm/include/asm/thread_info.h | 4 +-- arch/arm/include/asm/uaccess.h | 48 ++++++++++++++++++++++++++ arch/arm/kernel/signal.c | 71 +++++++++++++++++++++----------------- arch/arm/kernel/sys_oabi-compat.c | 10 +++--- arch/arm/lib/copy_from_user.S | 6 +--- arch/arm/lib/copy_to_user.S | 6 +++- arch/arm/lib/uaccess_with_memcpy.c | 3 +- arch/arm/vfp/vfpmodule.c | 20 +++++------ 9 files changed, 119 insertions(+), 59 deletions(-) --- 1.9.1