Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1359827ybk; Thu, 14 May 2020 07:08:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4b0ZJScsBeaUreXIvu9DFjjwQ1RK8IFu0xGYHfp0P40dRcCRd2LavyqSpUr0pfzPgHmlK X-Received: by 2002:a17:906:81c6:: with SMTP id e6mr3904902ejx.241.1589465327206; Thu, 14 May 2020 07:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589465327; cv=none; d=google.com; s=arc-20160816; b=IKwa1tyNb9eP79LyskuulNy5psRXoAq7uslf9DAAP6baBWaRUq3mdQNzI5v3LF5Krn lm4302+VwJrM2xQodfh7lgaq5fICDc0CQr6jPsEodV5myWHeH3qLVzfNWo9lv55YETXf XEscroniwN6mjCju/eLppH1InrFtr829y+L5lgLBmgOl07ocOXHSJOIh0SjPrXjo3/EL HRXvtS3QFBxSpOegwgAv1DMmoPd5N/exH+WA1MFwYCiBstjnsSiGMIetVmxJFpwjW+wQ Jwu9kzGt/IYiPliFjYkGdn/2/RSlZjBBLikbmShKlQzdakUu4dGm7SChe47Py4fsMi/k i4Ng== 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=NbY83E69uffAESaWml+T0AXcFZ6rmqCOkFWMnK8Nufs=; b=p2JMmhtp/2JA8X5brv17TFm7eNKhPKdTP9sYkNrsCNwAGiz7BgmqyuwDfJUMCmM9AA 5OkxqXbW4AZFrHnnnY/cImXmjFn+du86uQIfgerpT2HDTPxUvtMJta3YriuEQ/q+FmAd IT7z5w6mk6ekKmw8TtdpQwtcQ2JnTuBmzdS8NYvfYxEzKfcs//YoO4RfMLwV6b2TnUDU FYavkHhuw6CmJkB2UmbPnxkeOaIEFrYoS+FK/AV+ZiYdTmc0z1NaY6MRwB5JDQe6uE/3 41xFZaDAS7qMECJrUdHT41X9yjsQW7yRL18H5Qwwr62s/x9gSlH/DFdZ1PVfT5GZJxFJ E3/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bE86Yvyf; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si1908868eje.444.2020.05.14.07.08.23; Thu, 14 May 2020 07:08:47 -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=@redhat.com header.s=mimecast20190719 header.b=bE86Yvyf; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726582AbgENOGC (ORCPT + 99 others); Thu, 14 May 2020 10:06:02 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:44321 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726146AbgENOGC (ORCPT ); Thu, 14 May 2020 10:06:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589465160; 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: in-reply-to:in-reply-to:references:references; bh=NbY83E69uffAESaWml+T0AXcFZ6rmqCOkFWMnK8Nufs=; b=bE86YvyfZvtUCPkzAdLoxdk4poU67w0zrR+nhpvgnNTiOFGAPkXR7K4GylpCwTJHG0tovd r26yCRpPZans0fpd1zLlLjfWeJ97VOvX6Cyvj0sQR9RBesGbxCRpz2Iu9gcKB1a2SqTtrW Nm5VPRKM0I0Ecw+odcfqxGOQ+FzGypA= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-134-JnYc5_S1P5WlPb0cZcqGqA-1; Thu, 14 May 2020 10:05:57 -0400 X-MC-Unique: JnYc5_S1P5WlPb0cZcqGqA-1 Received: by mail-qt1-f200.google.com with SMTP id e44so3648229qta.9 for ; Thu, 14 May 2020 07:05:57 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NbY83E69uffAESaWml+T0AXcFZ6rmqCOkFWMnK8Nufs=; b=Pkx1DdPnzGcBs9pYGsRwTP8Au0NK/Ynyjhqt/2waUbf0Z3aAxrM/DQA/xj3r+CarVJ d4Kbx6VubXgf+gUonOS5WUTnThLu94uhjVIICmsQsb0dXquqYiH/4fLkDt+7GQTQdKFq Re6kEbOmwIiRbbsdvF3SzmmomieJVamvymAKv4BzOub3W+s9xhPV2BQ3NPagL8diFtCz H0Dor2ezZH8f05dAxEI5lFlnUNHweoD0mWq6BLiP2uXyD5vRzlqY4Z10GwZ5vY11hiaC JSyAFuOb5WWpe8q+p7ravu5qkSo12or1cKAcyqreaBSYHkplUE2IfaBhc17Dmg7YSECW Rmvg== X-Gm-Message-State: AOAM531MtiknxvmgypqNxzPYuQjBZHWnpWAVwAMDt6/VE447L6eglqCw xxR8RrLoFh9obp9VWz4vNiHRebZCkk96ysoNcWKrWMDBAqMH32jlTdfR9Lcn3syy9fxwj8z+XTD j3zZC4q8W3tbaoFVTBQJgSuIt X-Received: by 2002:a05:620a:4c9:: with SMTP id 9mr4749672qks.487.1589465156872; Thu, 14 May 2020 07:05:56 -0700 (PDT) X-Received: by 2002:a05:620a:4c9:: with SMTP id 9mr4749650qks.487.1589465156577; Thu, 14 May 2020 07:05:56 -0700 (PDT) Received: from dev.jcline.org.com ([136.56.87.133]) by smtp.gmail.com with ESMTPSA id z65sm2536791qkc.91.2020.05.14.07.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2020 07:05:55 -0700 (PDT) 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 RESEND] lockdown: Allow unprivileged users to see lockdown status Date: Thu, 14 May 2020 10:05:46 -0400 Message-Id: <20200514140546.826698-1-jcline@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200220151738.1492852-1-jcline@redhat.com> References: <20200220151738.1492852-1-jcline@redhat.com> 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 5a952617a0eba..87cbdc64d272c 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.26.2