Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp51258ybg; Mon, 8 Jun 2020 16:10:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrkP2HdcDY6GjpCcQb9IZz4KlTKbKtge/igErFO4w+GGyUn3XqO4h+BJlAkU2VVlcU1gvU X-Received: by 2002:a17:906:1904:: with SMTP id a4mr7195227eje.194.1591657832486; Mon, 08 Jun 2020 16:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591657832; cv=none; d=google.com; s=arc-20160816; b=an8ejPhiYRPB/iPMPw2hm1RE9BRHYg/mVYcJstnpTc4enkD6pJRrgDaDacDDK2RdeY CpYw9uAqW3781HKuWFhKPf2jqyRc3wkw07JizflajTSP7wPA85YZSK9qzhHFalOsj4+V dv99Bnr4K4j0JEOuq1/8vkb5IA0fyOVi/wKUvq4MrkYknco+W+B6CkfvOiVDv24K92q6 XJHGOlCSCv+1SLS6RpGvN5H+oLXaR+gE92THXr7dBONsdUNiigRcR9ERcQirB9OgvE11 F7aVGjJWSRJv8FfoLkAoF3u/jzaeceIwc9lpez93Klsy89rCOc8otqrV5bKE6slteupk QqWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fBnozgS03kAfTtAwfE03/C6XayTaCHplgMIv3dMQroo=; b=BeESr0Kdk+KC38DAuGq2J3QRaNEf6QThnJfR0jBgXiFveRhtAz+0hnP+bBDRlvQzUz m1EFVxT/aTUQEFn1fHB+dCmkF5J4glm7CHveX6xcAeov+RVGTNiNhh2S/SUSaKfWkA6J metTJ8bUtyUalbfHsBGVubiTn1Uj7shnAZ2mdfVSFgrgR3qxkyTyoLIWuQaxwvOCBe7r nIbFWtt44TJJZ4dEDDjrNjd4SRkX5NJlXyCGZO11H9G2m9BeTrZMuOm4Kmty0LaVDsqE UODbku0TNtBTLjK91W6roP/zMChJnIjWFs6O4K0l/pZhGey6nSaKWFCV8zHUUXeJkDvl xZMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EvyKP7PP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ks19si9184554ejb.409.2020.06.08.16.10.09; Mon, 08 Jun 2020 16:10:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EvyKP7PP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728009AbgFHXHs (ORCPT + 99 others); Mon, 8 Jun 2020 19:07:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:50864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727809AbgFHXHI (ORCPT ); Mon, 8 Jun 2020 19:07:08 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E230E20820; Mon, 8 Jun 2020 23:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657627; bh=xww3ha3RV/sRMp/8nxc5RDnUU7jjFcQdrVOpE9QJWXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EvyKP7PP36r1tHKLVdgkpW/otyMeNLX0oplZZ6vPn4TqeM11xoB7AgVjJr2RuSKET P7eanSnH6ZyD/cP2tVWJ2TzcdoKnV0H+ucJ5Atqxczoh+qMnKZ4WxQEZeCUpXgB22t pHrvBQMPqyMemO7lGtD67gT0W1diaiS77g8Opft4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jeremy Cline , "Frank Ch . Eigler" , James Morris , Sasha Levin , linux-security-module@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 047/274] lockdown: Allow unprivileged users to see lockdown status Date: Mon, 8 Jun 2020 19:02:20 -0400 Message-Id: <20200608230607.3361041-47-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Cline [ Upstream commit 60cf7c5ed5f7087c4de87a7676b8c82d96fd166c ] A number of userspace tools, such as systemtap, need a way to see the current lockdown state so they can gracefully deal with the kernel being locked down. The state is already exposed in /sys/kernel/security/lockdown, but is only readable by root. Adjust the permissions so unprivileged users can read the state. Fixes: 000d388ed3bb ("security: Add a static lockdown policy LSM") Cc: Frank Ch. Eigler Signed-off-by: Jeremy Cline Signed-off-by: James Morris Signed-off-by: Sasha Levin --- security/lockdown/lockdown.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c index 5a952617a0eb..87cbdc64d272 100644 --- a/security/lockdown/lockdown.c +++ b/security/lockdown/lockdown.c @@ -150,7 +150,7 @@ static int __init lockdown_secfs_init(void) { struct dentry *dentry; - dentry = securityfs_create_file("lockdown", 0600, NULL, NULL, + dentry = securityfs_create_file("lockdown", 0644, NULL, NULL, &lockdown_ops); return PTR_ERR_OR_ZERO(dentry); } -- 2.25.1