From patchwork Thu Aug 9 15:26:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Thierry X-Patchwork-Id: 10561537 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 6926A13B4 for ; Thu, 9 Aug 2018 15:27:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 505D12B560 for ; Thu, 9 Aug 2018 15:27:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4425E2B581; Thu, 9 Aug 2018 15:27:15 +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 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 ED1142B560 for ; Thu, 9 Aug 2018 15:27:14 +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=k0YBNNGD212tjgoIQoSe5TaKjUqb/+lZ9hqRL90Tp3M=; b=LWg UIi7W0PHqjchv/56tlseM0bAY6CG6k7XGc91ic4qboc5oSmi8C367v1j24dPLhslPZIjM7R7OJiQt MxLGuLf/3gy44KCf8U2+fEnpBAR0HIvxTbLRlkr0Om1/oVyO1ihj1drFiFHq94OHyRFohkqH9ru4K 40Fg7Z2NrwvfEjs7R/1f7JIL6nHocsnDukpVFX1HbIdgHpRkWDprk1AAby39e9EMFbZ4s9q7si2vm s6jtvpU5M4pn7GQPtJhHkb2GJiQO9Zz5UNTfw4yHlqnM5Mu7GIuSou9Ihpb7cXO50dvvdCx4LaAkL S4T3bvouanF51QJnZI9dsGSLgEU27Mw==; 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 1fnmqH-0002Nv-0o; Thu, 09 Aug 2018 15:27:13 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fnmq6-0002DH-U4 for linux-arm-kernel@lists.infradead.org; Thu, 09 Aug 2018 15:27:04 +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 994E57A9; Thu, 9 Aug 2018 08:26:50 -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 872BC3F5B3; Thu, 9 Aug 2018 08:26:49 -0700 (PDT) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/8] ARM: spectre-v1.1 mitigations Date: Thu, 9 Aug 2018 16:26:35 +0100 Message-Id: <1533828403-21323-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-20180809_082702_994059_2963C5C7 X-CRM114-Status: UNSURE ( 9.16 ) 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, linux@armlinux.org.uk, 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, This series applies on top of Russell's latest spectre variant 1 mitigations [1], This is mostly mirroring what Russell did, 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