Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1955572imm; Thu, 24 May 2018 03:33:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpi6d2HvRUDdE4mrfUeDgOGPOljYHaUbw6jZYvN7Rluyig5lep1Zqw9XtCAB01DDH8bR+jA X-Received: by 2002:a17:902:b907:: with SMTP id bf7-v6mr6772219plb.331.1527158034138; Thu, 24 May 2018 03:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527158034; cv=none; d=google.com; s=arc-20160816; b=ya8tZznI6uPOR7ffgelbdu1XrmBtYHR1pRbV0BO5FWWG2hGiFjmdZmSmMTAn7FfFdb cKtFubhOZAl3vbXHcEEMTkFOtf1oaA6jBOwSS0tBpCzVPPnsMY3uiLGyAn++yriKBC8V l3XQg68W/Jev90cKwsAsBoSeAnhWSn1CfphSiEOcIbC3XbLe+MYQcDdCuFwF3p15MR7R BQ1eEcU87CD+/k+5UQsdzlEzyW65XsuOR8K3rkwkzmrZ+NNlN5UGZY4Saub0k4CZ32kn aIdNd03w+GelXNYii0HMstpETqGQGpsbSZxn2hdubMNYWH/jy6rQ5ZnYiJ9stXTiH2uZ 97dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=KoVKndfSTZ5BljIyIq3co4a8lbiFBBaumbuKKpRMTO8=; b=qmmTtEiglwNmj7iAUnrQADMShGiWayHkk4TqH3z6NwjCvE12NJxQDwsH5EIgvxDzeO v/o5LufGZImzsKEHLAm5Jat3N8+CYdy/JAoqVWtS5aDeeEwtQTbmansiyL/P4hB7L8Po nRLNFXy3pE6S2+R7+fs4l4eOKJTA2H713fG/PW3lca1Vi/OU5AMsMC10MybkWmMVftly cBMuTsAqYek5eZvzt/y6x217qn6wHN3lBGNknlB1a2KfEgx6lpjjR87vJ3HMhLmLlLcw AuC6VAVNcGTu33qsYDE+bIIaapM705RrkhP6fmd+OgDGyGp3nB1V7UXGI0YS9koTv1FG Tp2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0s6w8+UK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z26-v6si22912149pfl.209.2018.05.24.03.33.39; Thu, 24 May 2018 03:33:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0s6w8+UK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032183AbeEXKct (ORCPT + 99 others); Thu, 24 May 2018 06:32:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:44028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965657AbeEXKAs (ORCPT ); Thu, 24 May 2018 06:00:48 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 036D920870; Thu, 24 May 2018 10:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156047; bh=vJxawDtiol1tq38/ji//YV10pRHJqHJ/jcfR5Xxu2Iw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0s6w8+UKXX18KyGWAxKnDekxdDyOOyRRaarHSiL1NOx9abN4w6bKwfiCSnJvBROSc ZQWwXPXKWPHGOKrar2aC/BuTv9JwPCq4YoIm/e1SBuf+QkrHn/P4zBCHLomLJKkF6k TSKdL3j7/Z283AQAU3U8QB5QdTaPGwHcsC87ZLyc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, greg@kroah.com Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman Subject: [PATCH 4.16 044/161] powerpc/64s: Wire up cpu_show_spectre_v1() Date: Thu, 24 May 2018 11:37:49 +0200 Message-Id: <20180524093023.640028407@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Ellerman commit 56986016cb8cd9050e601831fe89f332b4e3c46e upstream. Add a definition for cpu_show_spectre_v1() to override the generic version. Currently this just prints "Not affected" or "Vulnerable" based on the firmware flag. Although the kernel does have array_index_nospec() in a few places, we haven't yet audited all the powerpc code to see where it's necessary, so for now we don't list that as a mitigation. Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/security.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/arch/powerpc/kernel/security.c +++ b/arch/powerpc/kernel/security.c @@ -50,3 +50,11 @@ ssize_t cpu_show_meltdown(struct device return sprintf(buf, "Vulnerable\n"); } + +ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute *attr, char *buf) +{ + if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR)) + return sprintf(buf, "Not affected\n"); + + return sprintf(buf, "Vulnerable\n"); +}