From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Garrett Subject: [PATCH V32 25/27] lockdown: Print current->comm in restriction messages Date: Wed, 3 Apr 2019 17:32:47 -0700 Message-ID: <20190404003249.14356-26-matthewgarrett@google.com> References: <20190404003249.14356-1-matthewgarrett@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20190404003249.14356-1-matthewgarrett@google.com> Sender: linux-kernel-owner@vger.kernel.org To: jmorris@namei.org Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, linux-api@vger.kernel.org, luto@kernel.org, Matthew Garrett , Matthew Garrett List-Id: linux-api@vger.kernel.org Print the content of current->comm in messages generated by lockdown to indicate a restriction that was hit. This makes it a bit easier to find out what caused the message. The message now patterned something like: Lockdown: : is restricted; see man kernel_lockdown.7 Signed-off-by: David Howells Signed-off-by: Matthew Garrett --- security/lock_down.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/lock_down.c b/security/lock_down.c index 9913fff09ad0..2659722784cc 100644 --- a/security/lock_down.c +++ b/security/lock_down.c @@ -70,8 +70,8 @@ bool __kernel_is_locked_down(const char *what, enum lockdown_level level, bool first) { if ((kernel_locked_down >= level) && what && first) - pr_notice("Lockdown: %s is restricted; see man kernel_lockdown.7\n", - what); + pr_notice("Lockdown: %s: %s is restricted; see man kernel_lockdown.7\n", + current->comm, what); return (kernel_locked_down >= level); } EXPORT_SYMBOL(__kernel_is_locked_down); -- 2.21.0.392.gf8f6787159e-goog