Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1956020imm; Thu, 24 May 2018 03:34:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr3ziBV/34t5+MNnkV8U2DnSrR/4dcdZOkbmK1UOmuUtVPUbJhU+IgcpZl1U02+o0JRSSFX X-Received: by 2002:a63:6142:: with SMTP id v63-v6mr1870499pgb.390.1527158060097; Thu, 24 May 2018 03:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527158060; cv=none; d=google.com; s=arc-20160816; b=wSl/1lxTdCzOeK2ZojlFgmCXbNjkG6b7c5qPVS8ygreOY2MJgdOdbPFKsr8RswID2z 4mIZSL6aNOq3K16Ij42xOIF24kGEk+eL7EcYEB/7qCQ5oPENS9M04zvTH/m79vt6Sgez Yp4IxXodH71h114IBIr+QuiuIyKew3NBbr9Godt1IK6x9QmyNUR9kF+PtKuHiJkTxS0B l70qjJF87+3Ym00GXmwG6wx0GOEiaMAvBXJU+E3Tn7aCpilGKXq8Z/kDDGKVHE36KrkA RG839FXNlq3YQInjHR/a81cX+KERYoCUcnG2zYXDsL3sT89GtULv35wMYpfrZd6YsHRH PCGg== 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=PiJ3d8GXdKbX0OD+IoFl7+TP5fF+feLGdMM9SNUDLEk=; b=klyO9grp24d/mVuAw01Klp7YyVWbn9iymfHNC6wsWIxIAkAhj62WUG0dFZfvVb/UeN 1EqOmm8qzQeOIMUWmy9Kc6PUy/usOUh6xFMEYCdL4EnIRxvxxfh1zl0T9BkHDwq714s1 oOAfDYN3zb3EM0nHN32vQD0iwbmcFwEzh7v3pzzcKEivTTBKm1JYS3FgudOt1jRetPlc Kdoo/2Cbmbr2u5P30WaLTW1bGprmGi4jVSUChmcbp2Fwa66uJnbQPp2jZDsG23jHEA6t LmF0/ABHJU3OiMzN/AUgSK4YlZ7kMNVN+c5TR4xrTUlSk28vqFtKqF/E3v0ptpDikKzJ Mmsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rpK7894z; 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 z9-v6si23095407plk.94.2018.05.24.03.34.05; Thu, 24 May 2018 03:34:20 -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=rpK7894z; 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 S1032174AbeEXKcH (ORCPT + 99 others); Thu, 24 May 2018 06:32:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:44784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968508AbeEXKA4 (ORCPT ); Thu, 24 May 2018 06:00:56 -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 3406E2088E; Thu, 24 May 2018 10:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156055; bh=glvGhDHYxqzilxP8vrEUWH1IPbzu+jMmmMKueHOVttc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rpK7894zhfhykdq3VCoYqBCMiCclIuc5WsmPXR90W28RcfYDoiSjolr/GmqC/84Hj 4ISWG8IibdyCPDAv333CGiiYCSg9Z9XL/TGG3c8fUqdOr4m0gkNSnRgX4/PmFxrGSc QdRyTP+VcJ+iY+0Lkmxy5Q5Wsul0XIKpKiJslez4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, greg@kroah.com Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mauricio Faria de Oliveira , Michael Ellerman Subject: [PATCH 4.16 047/161] powerpc: Move default security feature flags Date: Thu, 24 May 2018 11:37:52 +0200 Message-Id: <20180524093024.048578311@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: Mauricio Faria de Oliveira commit e7347a86830f38dc3e40c8f7e28c04412b12a2e7 upstream. This moves the definition of the default security feature flags (i.e., enabled by default) closer to the security feature flags. This can be used to restore current flags to the default flags. Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/security_features.h | 8 ++++++++ arch/powerpc/kernel/security.c | 7 +------ 2 files changed, 9 insertions(+), 6 deletions(-) --- a/arch/powerpc/include/asm/security_features.h +++ b/arch/powerpc/include/asm/security_features.h @@ -63,4 +63,12 @@ static inline bool security_ftr_enabled( // Firmware configuration indicates user favours security over performance #define SEC_FTR_FAVOUR_SECURITY 0x0000000000000200ull + +// Features enabled by default +#define SEC_FTR_DEFAULT \ + (SEC_FTR_L1D_FLUSH_HV | \ + SEC_FTR_L1D_FLUSH_PR | \ + SEC_FTR_BNDS_CHK_SPEC_BAR | \ + SEC_FTR_FAVOUR_SECURITY) + #endif /* _ASM_POWERPC_SECURITY_FEATURES_H */ --- a/arch/powerpc/kernel/security.c +++ b/arch/powerpc/kernel/security.c @@ -11,12 +11,7 @@ #include -unsigned long powerpc_security_features __read_mostly = \ - SEC_FTR_L1D_FLUSH_HV | \ - SEC_FTR_L1D_FLUSH_PR | \ - SEC_FTR_BNDS_CHK_SPEC_BAR | \ - SEC_FTR_FAVOUR_SECURITY; - +unsigned long powerpc_security_features __read_mostly = SEC_FTR_DEFAULT; ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf) {