Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp787512ybv; Thu, 20 Feb 2020 07:18:35 -0800 (PST) X-Google-Smtp-Source: APXvYqyEL/WiX3vj30U5NeRQyRcK+/TuJjT5PDwPPQgPHuNccg4Ufzl98+eNyHVX8upFagsHLn1s X-Received: by 2002:a9d:518b:: with SMTP id y11mr22777570otg.349.1582211915805; Thu, 20 Feb 2020 07:18:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582211915; cv=none; d=google.com; s=arc-20160816; b=Gl+uSbyGUlKTOK91z+/rgKOWI0glTLR5OEMPW50vxXrgRADob0NpmJhUXawg2IcizN mT8SeHyMFDDFouV3ZxWZ6S9b6Nbe8ahNwI85SbB6QtPEgCPdXhez5wCLPFPD6af/OTWE 2N9vmaXbtpcLCiWQiLSYSqszf/fMs619bx1vRYh2tshzAWP2KzygUF9tXcXVl6nfm3YS neYVt2b3QDztRBnPA84zqIh5yGwb8hTZhP2L/BlVlT29QqkowLt/2VQx9uUFvAE1wZSY fObA91s+rFranGaB4zsz8Pk01MNsubtQjSkgNut8VsuNLKdcd07aTfUaSJu3V0Keh4By vInQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=H6BruQnFBwNb5cCVI9YyRz/YJpU0LA0uIbUnirbUfIk=; b=Zc+rAgCBFtdfjejzkX0K7bD2gd3FRMFl51vFYnP1leqYy3vjYH0B8ll8RTle6dZFxc Zz2pmARivOWXmgFjsEbVe1UcMUBFrXJ95h5UCCWQrgLKB2FM7+NRpI5U/lb18dqW4v1K gN1bNuwDoB1nl0PRL/fcCD8wFhy7w0tiRPOS6anBpkShpzqg7RcIguqo0tzOoqOP/tfu tNjusvm5tWCXBfKNPHbqqgqDRz/0d6RWq5qOyx8F599/gCgqXqLtZVmVUIaxbuA8/bCk c3+fos3ZELz8awg9wN+Un/nJVEcOi93Bav4JG6EBSxBYsY1jmh/VxXX62nzPZbnFRhxu HATA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Hkvx/Wix"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si10882937oia.238.2020.02.20.07.18.21; Thu, 20 Feb 2020 07:18:35 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b="Hkvx/Wix"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728383AbgBTPR4 (ORCPT + 99 others); Thu, 20 Feb 2020 10:17:56 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:53681 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728079AbgBTPR4 (ORCPT ); Thu, 20 Feb 2020 10:17:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582211875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=H6BruQnFBwNb5cCVI9YyRz/YJpU0LA0uIbUnirbUfIk=; b=Hkvx/Wixz4i+zYpRIukWhWkjkLZ/5RG/IeXjZn8j1ksLMy6BAAzP1t9tUCmQ58k1yCK1sA 3PH55uwFkt2ULSOK6+WfIfpT4zgENNpnnjL7JJ9aoV7t7MJsjzeiiTdfFUUofKpfANMr0K l6zklVyg0OtWvuSabadF+P8Yhxk8W6c= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-vBsGY5L6O4-Gy83Mp8AEbg-1; Thu, 20 Feb 2020 10:17:53 -0500 X-MC-Unique: vBsGY5L6O4-Gy83Mp8AEbg-1 Received: by mail-qv1-f72.google.com with SMTP id s5so2746832qvr.15 for ; Thu, 20 Feb 2020 07:17:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H6BruQnFBwNb5cCVI9YyRz/YJpU0LA0uIbUnirbUfIk=; b=MrkMQsMnVuiVKQ6TycuSHvejXsPwLf+fkAkmZ2JLKaqOYKOkM8dq86vxJG5SJFz8Cj iJYHrYq3GnIvmi7NzfKbSDbzMJlFaN6qdAYAIknmlo+p1sZnAGbYEha1TudlntKrrFvq S8XV4LsQiVtJGEkvt12HUxyFlZIBf2VmdV2+6CANvb50CfFnNpMloyLsJG2Tjxmw7k7R AyxJHU3K9n1A4z3PDfKownXcyAXPzwznyuM0rry6fO2CJRrGz8NTgag5OTj7PfT+eWUB zQ1wibHgBZBVp99o8TphJXqAfBNYvS0CRM3DvbgRnaFYRvzaFlTym731mM2CpXL+QuRM kM3g== X-Gm-Message-State: APjAAAUz3E7cvXuDpw4h7VclinCmXibnbhYsCef2ZM6e7aXA6g+Fn/VP RQgL0nFtpB/ESLxpO5EH7hwuXmFEaWmmieFJk5TP1yPVj5oXZpLladKrz2Go7ZVg7ie6UjyBFsO 4P+y/1n2z/W6T2sKSxqhyLJJ5 X-Received: by 2002:a05:620a:125b:: with SMTP id a27mr26970116qkl.203.1582211872521; Thu, 20 Feb 2020 07:17:52 -0800 (PST) X-Received: by 2002:a05:620a:125b:: with SMTP id a27mr26970077qkl.203.1582211872261; Thu, 20 Feb 2020 07:17:52 -0800 (PST) Received: from dev.jcline.org ([136.56.87.133]) by smtp.gmail.com with ESMTPSA id 82sm649897qkd.77.2020.02.20.07.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 07:17:51 -0800 (PST) From: Jeremy Cline To: James Morris , "Serge E . Hallyn" Cc: Matthew Garrett , David Howells , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Cline , "Frank Ch . Eigler" Subject: [PATCH] lockdown: Allow unprivileged users to see lockdown status Date: Thu, 20 Feb 2020 10:17:38 -0500 Message-Id: <20200220151738.1492852-1-jcline@redhat.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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.24.1