Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp795305imm; Mon, 21 May 2018 14:37:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqKe23cschXRBQYe8YPCCjaJA6vNpAYpptHxAEDGsOfY80ZA41SpGY6tyZgJ5yLMPQIGiGf X-Received: by 2002:a17:902:2bc5:: with SMTP id l63-v6mr21493497plb.299.1526938624407; Mon, 21 May 2018 14:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526938624; cv=none; d=google.com; s=arc-20160816; b=mMJJTfZvGO5I9smsQ5gLhVk2nU117SC4AT0NI91czpnPezTzBQe5vovITghGpvK4ga cvPbOf0wYjBJ7O5pIJksmVTAcvSqnuWIHnxPxUtitezK0x/4X/SV+4xtczUhRTcxY5p6 yvXwcZeUV0FVxyYRiQ6ThDbNHVvtPw/ow6g0lMVuz6FBVQBCw1OwrnY+s0+W4QKTLNKy R7tAljT2d0O95TmQnbJS/uvX/VGNsSAyHMplcpcaOrrgw+5GXtUod+8+1NbSMMekWetE cqyadRB5p5l+rnIfRYo1f7m0uOnjxHbBG/bXwIE2snOTIqrAKOlFkYpLZkXwU2iuACDZ gYwA== 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=e6c4duRE+ZH+UbsUKx+0oVmngMphFKOlINvbWnBkbJg=; b=oNgVQXUjpzUEZMMbE5rfOeYUa+h0fQqvgU3b8mTjIicxMhpAhTK2KQ0Fso/58/K1M4 rKWLbHNmZyNwCL3gwFp+9M80FQNcwt6EcTFDKXymFXi84s8CMmPvCXTClEU1Uc3zcwse RbSH4uW05TP7sObzZapLa7vhLrYYITt/nw7P6s39Gjt/o+SV+1tQxLoB8mkCPxD4D16D VMBeJsmHW6vce5SfGwLGC8SzfW7MP95cWMaYfloIlAsT/3nBHiVCZ6TdHZpiplkidYxt SJohCJrzwvqryUsBMIWgM3D+386yz8PF8ayN9BklLKU91fitrpOYE9BYWipRSyTdz2dX YUxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m4xQRGGV; 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 u6-v6si14274435pfm.183.2018.05.21.14.36.50; Mon, 21 May 2018 14:37:04 -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=m4xQRGGV; 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 S1754606AbeEUVgm (ORCPT + 99 others); Mon, 21 May 2018 17:36:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:40400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932440AbeEUVZc (ORCPT ); Mon, 21 May 2018 17:25:32 -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 4C94C20872; Mon, 21 May 2018 21:25:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526937931; bh=iBBo+ejn/SoJolb6IHaAMgZyt3oYn3Vknb6YZPd2bI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m4xQRGGVM2qrQhYfar2M5fyfnKHp6BOwxRW73K+JMfFmP2Sv+lTvMSU30dJmBS/fO Rwj2ihc9R8H3p0pGgTGfDxgNEgcQ28Gf7NJbGf5/nWkudrJ/wuLXctad68rR6LsuJa 5FE+tbE4RrlWOPwkYu+eKk87kYvUNqj9RsH7dW8k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Thomas Gleixner Subject: [PATCH 4.16 079/110] proc: Provide details on speculation flaw mitigations Date: Mon, 21 May 2018 23:12:16 +0200 Message-Id: <20180521210513.220298217@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180521210503.823249477@linuxfoundation.org> References: <20180521210503.823249477@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: 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: Greg Kroah-Hartman --- fs/proc/array.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -85,6 +85,7 @@ #include #include #include +#include #include #include #include @@ -347,6 +348,27 @@ static inline void task_seccomp(struct s #ifdef CONFIG_SECCOMP seq_put_decimal_ull(m, "\nSeccomp:\t", 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'); }