lockdown: Print current->comm in restriction messages
authorDavid Howells <dhowells@redhat.com>
Wed, 28 Feb 2018 14:43:03 +0000 (14:43 +0000)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 26 Sep 2019 12:19:06 +0000 (13:19 +0100)
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: <comm>: <what> is restricted; see man kernel_lockdown.7

Signed-off-by: David Howells <dhowells@redhat.com>
Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name 0030-lockdown-Print-current-comm-in-restriction-messages.patch

security/lock_down.c

index 527f7e51dc8de092d33be4085cbfbc6193129a29..4745278e0f3bbb7bb9624e6e29b8f668692e1d61 100644 (file)
@@ -60,8 +60,8 @@ void __init init_lockdown(void)
 bool __kernel_is_locked_down(const char *what, bool first)
 {
        if (what && first && kernel_locked_down)
-               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;
 }
 EXPORT_SYMBOL(__kernel_is_locked_down);