Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5765651imm; Mon, 23 Jul 2018 05:49:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcbtp1UytjL5uLFeTWqtvQ9+Xm29lRECLM2DVz7clKYAXfQm6Cg+oweW89ZsFbhvLhRVDEZ X-Received: by 2002:a62:3a9d:: with SMTP id v29-v6mr13143453pfj.215.1532350177792; Mon, 23 Jul 2018 05:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532350177; cv=none; d=google.com; s=arc-20160816; b=GbJihBoEeo2CK358Z5Mh91JC4j1h4jZpBOsa9m7aIN5fZq052YGuEA/FAY5RIIPoYV /xhoykrF2mLqwB/zSMBnHshKKhiJzQTn8paocwb+IGohRVG59Ye6mXFHuhnJj1stbdq0 BQ0wgiqIdX4MoxWagyZym0ETAwKJppF5TnEdLzV2Xa5DT72zXfNldrvNo6EcamkqxvGe uqmJZYNAtpDwi92hmRH4pCCP7VOIvzPYhk1HiRPmvKPNabFIWVMq2HBHyV1UD4is/1K0 A2h+CP1s7EUDYYV5V7h1MSO/mxxKGTV7Na5IXxnygRvCuKpt+ars0mgr9kujRcpYgD/q itSQ== 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 :arc-authentication-results; bh=C9piWgIrgy7L4A2Az27/fset+jZw1TZpm2zE9MK9mgM=; b=EF/Tk4mXPufMD2jYKXthoNWNpBgAxcnMtdMrLUVN+rcN0GoBlxBxHqV5fbC2Xk1mQI YCt/D1S8trN4qFKrYUx4Ls2PjFbK0x/EmrADl90VhziSxBU9T4E6fO85pf0XmtTrYhXc paM0lr346rUBFzkQ3dgrUTWZuTSgD0YGyMMvc3/PXXHMyv1bZGXny+a4DtV8hSLZK6+F Fb438X06cp8IL6A6zw5z1c+6ueXtdz6eLFZtzbgGqxVgDEQqmPSO6jxyNSC7PThe6DSj FOoaKryaa69BG4vS9PVJgdJBEjQAWCWSMgVqjsRzxL1xWDUCojLkvlJOA7DNeM7cp6RU OUcg== ARC-Authentication-Results: i=1; mx.google.com; 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 g6-v6si7734270plq.242.2018.07.23.05.49.22; Mon, 23 Jul 2018 05:49:37 -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; 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 S2389792AbeGWNsg (ORCPT + 99 others); Mon, 23 Jul 2018 09:48:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51978 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389783AbeGWNsf (ORCPT ); Mon, 23 Jul 2018 09:48:35 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7D53EC19; Mon, 23 Jul 2018 12:47:30 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Thomas Gleixner , David Woodhouse , "Srivatsa S. Bhat" , "Matt Helsley (VMware)" , Alexey Makhalov , Bo Gan Subject: [PATCH 4.4 069/107] proc: Provide details on speculation flaw mitigations Date: Mon, 23 Jul 2018 14:42:03 +0200 Message-Id: <20180723122416.842361818@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180723122413.003644357@linuxfoundation.org> References: <20180723122413.003644357@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kees Cook commit fae1fa0fc6cca8beee3ab8ed71d54f9a78fa3f64 upstream As done with seccomp and no_new_privs, also show speculation flaw mitigation state in /proc/$pid/status. Signed-off-by: Kees Cook Signed-off-by: Thomas Gleixner Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman Signed-off-by: Srivatsa S. Bhat Reviewed-by: Matt Helsley (VMware) Reviewed-by: Alexey Makhalov Reviewed-by: Bo Gan Signed-off-by: Greg Kroah-Hartman --- fs/proc/array.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -79,6 +79,7 @@ #include #include #include +#include #include #include #include @@ -332,6 +333,28 @@ static inline void task_seccomp(struct s #ifdef CONFIG_SECCOMP seq_printf(m, "Seccomp:\t%d\n", p->seccomp.mode); #endif + seq_printf(m, "\nSpeculation Store Bypass:\t"); + switch (arch_prctl_spec_ctrl_get(p, PR_SPEC_STORE_BYPASS)) { + case -EINVAL: + seq_printf(m, "unknown"); + break; + case PR_SPEC_NOT_AFFECTED: + seq_printf(m, "not vulnerable"); + break; + case PR_SPEC_PRCTL | PR_SPEC_DISABLE: + seq_printf(m, "thread mitigated"); + break; + case PR_SPEC_PRCTL | PR_SPEC_ENABLE: + seq_printf(m, "thread vulnerable"); + break; + case PR_SPEC_DISABLE: + seq_printf(m, "globally mitigated"); + break; + default: + seq_printf(m, "vulnerable"); + break; + } + seq_putc(m, '\n'); } static inline void task_context_switch_counts(struct seq_file *m,