From patchwork Fri Feb 23 10:42:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinpu Wang X-Patchwork-Id: 10237451 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 5E927602DC for ; Fri, 23 Feb 2018 11:26:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5309D2952F for ; Fri, 23 Feb 2018 11:26:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4720929538; Fri, 23 Feb 2018 11:26:06 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED 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 483CB2952F for ; Fri, 23 Feb 2018 11:26:05 +0000 (UTC) Received: (qmail 19758 invoked by uid 550); 23 Feb 2018 11:23:12 -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 Delivered-To: moderator for kernel-hardening@lists.openwall.com Received: (qmail 5505 invoked from network); 23 Feb 2018 10:42:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZmMuJvpDzup4ajTAMsSeYI2AYHbGmfeRKNDfM/K26k8=; b=erTnw6YSxXi4JhNYNwoP6N4B4UW9MRdhT2WIoZ9L6KNWm7jl1vaQ3SrtH70w5GweQF deEAFwcKE65ebkie1pHrCRM02DZD+mevkexkvimY+68P9Yl6y1obc7no73LRaW3W8xbO qg8suWh2Oer1oec9rKrBnxhJS36I6gM62lYcnfHcLa/DR+mrMO5t5LFEY1VNhq3+nZbG Uggm/JJ6ZRI+A1kytYc3J7eCG3K6NWg/052Q4sNjN3lxbw4b0a6UmAoW4ssf9ZH1b52C XCLpFs6LxBw52+2XIYYxdjzcvUdthxX11VytWwvNZ6Z8f7TUL41w7ColJANTCtU1/hZl q7aQ== 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=ZmMuJvpDzup4ajTAMsSeYI2AYHbGmfeRKNDfM/K26k8=; b=YYghzWqYbyZR3x+VjiZmdDZDzqZ/1MpX/X0lRKn+95UEvYsUgdhBf/R4gHvWaSmHG5 S782g/WBba1T/RUsrg4zHorn8MreIzfdG/M5aKuXs9Bu50QNs0X0mEhRVxxcaybrKe6/ 3s38r90U3FoLHglWaQzQMapXRdonz+jNU0LvrHbfhPottk9Iu2YyLC+WZDrzGFHoMwX8 AGG5yRRU+n/YzGQ+Yxg8SFBkW3rr9JlKZRpy7rE/QKtRM8ZZ47uql1t2eFpmJA6G/TmX YrEMNK+g09PbaKn5VUXSVJA1IpuNawHHOLTv/hhefc9Nykl10yd6xYpLi+p5+HZDaLtB b87g== X-Gm-Message-State: APf1xPDpw0wyrZCJSR4j/URjFgBzQ0dH4s9UOEO2Eh+S0Y+W/QEWUQJe sCDu1u+Z28B5eoIAD0T/dyApCQ== X-Google-Smtp-Source: AH8x226+OEgEnLaBHZOoNTfDux/b/Ak5SH6PfI378tXQgnj8pmUrdjofYL1G+pk5zsoPrwm1QCZ9vw== X-Received: by 10.223.189.8 with SMTP id j8mr1290885wrh.20.1519382561526; Fri, 23 Feb 2018 02:42:41 -0800 (PST) From: Jack Wang X-Google-Original-From: Jack Wang To: gregkh@linuxfoundation.org, stable@vger.kernel.org Cc: Dan Williams , Thomas Gleixner , linux-arch@vger.kernel.org, kernel-hardening@lists.openwall.com, torvalds@linux-foundation.org, alan@linux.intel.com, David Woodhouse , Jack Wang Subject: [stable 4.4 18/29] x86/spectre: Report get_user mitigation for spectre_v1 Date: Fri, 23 Feb 2018 11:42:07 +0100 Message-Id: <1519382538-15143-19-git-send-email-jinpu.wangl@profitbricks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519382538-15143-1-git-send-email-jinpu.wangl@profitbricks.com> References: <1519382538-15143-1-git-send-email-jinpu.wangl@profitbricks.com> X-Virus-Scanned: ClamAV using ClamSMTP From: Dan Williams (cherry picked from commit edfbae53dab8348fca778531be9f4855d2ca0360) Reflect the presence of get_user(), __get_user(), and 'syscall' protections in sysfs. The expectation is that new and better tooling will allow the kernel to grow more usages of array_index_nospec(), for now, only claim mitigation for __user pointer de-references. Reported-by: Jiri Slaby Signed-off-by: Dan Williams Signed-off-by: Thomas Gleixner Cc: linux-arch@vger.kernel.org Cc: kernel-hardening@lists.openwall.com Cc: gregkh@linuxfoundation.org Cc: torvalds@linux-foundation.org Cc: alan@linux.intel.com Link: https://lkml.kernel.org/r/151727420158.33451.11658324346540434635.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman [jwang: cherry pick to 4.4] Signed-off-by: Jack Wang --- arch/x86/kernel/cpu/bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index d3b8337..812813e 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -291,7 +291,7 @@ ssize_t cpu_show_spectre_v1(struct device *dev, { if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1)) return sprintf(buf, "Not affected\n"); - return sprintf(buf, "Vulnerable\n"); + return sprintf(buf, "Mitigation: __user pointer sanitization\n"); } ssize_t cpu_show_spectre_v2(struct device *dev,