From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Subject: Re: [PATCH V33 27/30] lockdown: Print current->comm in restriction messages Date: Thu, 20 Jun 2019 21:09:38 -0700 Message-ID: <201906202109.F7662EB8@keescook> References: <20190621011941.186255-1-matthewgarrett@google.com> <20190621011941.186255-28-matthewgarrett@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190621011941.186255-28-matthewgarrett@google.com> Sender: linux-kernel-owner@vger.kernel.org To: Matthew Garrett Cc: jmorris@namei.org, linux-security@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, David Howells , Matthew Garrett List-Id: linux-api@vger.kernel.org On Thu, Jun 20, 2019 at 06:19:38PM -0700, Matthew Garrett wrote: > 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/lockdown/lockdown.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c > index 14edc475d75c..408f0048f8a2 100644 > --- a/security/lockdown/lockdown.c > +++ b/security/lockdown/lockdown.c > @@ -80,8 +80,8 @@ early_param("lockdown", lockdown_param); > static int lockdown_is_locked_down(enum lockdown_reason what) > { > if ((kernel_locked_down >= what) && lockdown_reasons[what]) > - pr_notice("Lockdown: %s is restricted; see man kernel_lockdown.7\n", > - lockdown_reasons[what]); > + pr_notice("Lockdown: %s: %s is restricted; see man kernel_lockdown.7\n", > + current->comm, lockdown_reasons[what]); > return (kernel_locked_down >= what); > } Maybe needs ratelimiting? > > -- > 2.22.0.410.gd8fdbe21b5-goog > -- Kees Cook