From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B83E8C43613 for ; Fri, 21 Jun 2019 04:09:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 89CA320679 for ; Fri, 21 Jun 2019 04:09:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="NleuHgZJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726055AbfFUEJl (ORCPT ); Fri, 21 Jun 2019 00:09:41 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40805 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbfFUEJk (ORCPT ); Fri, 21 Jun 2019 00:09:40 -0400 Received: by mail-pf1-f195.google.com with SMTP id p184so2863427pfp.7 for ; Thu, 20 Jun 2019 21:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=s+s/XSWVXkMdm2LhsY97bPHzncR03/yzplCNbJ4zAnU=; b=NleuHgZJxbf2bxIW5QCtsY+dKkhc5T/rAVLCWaztJ1qrdcVBIHlpEDmP3xMUP8eKh8 73toW62S4i2QSAS9AMrp+Cqj0ue16FPdKbh2JTsCmwKgYThnNOOFpBWR6LH/RPhYXGV4 tDcCjXb7IgGi84/+G+GMw6dpHN8vCNKrh0zkY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=s+s/XSWVXkMdm2LhsY97bPHzncR03/yzplCNbJ4zAnU=; b=CsrSDGLAaduAVKC3WDllvvQhD5ru+zO8tBSj8ccdmHbTxTQmSOCetihL5+VKSXD6zL xXMXisvpVwgPcHochneRkuJ/VV4QdadWgAbTzQRmEVIaWcIB4UVteoh8xMUMMwb7BD3A UtBtLVDZVTITl/isowh52GsYyEHGwrkjBNxbkZhIgtIdh6QX+D4hLf5SWUQhCaDMmu8T 0Wtwhg+o0wz1heaPB1dcC8Y81mkpJ4Je+lD9dWO9jcSkIaIKtWVkadYvyHnP+8VKQuyz wtOlaRpSHBhW+WpdTBXShkxoXF9sDUGsXvoNoCrVkDat4NwZs5A+07m2CV4R9xobfyUN fktw== X-Gm-Message-State: APjAAAU8XypjFmWewzIO5FVg3RHpSmJIW12oacbrXkbhF/WZExBtnFzD JBUqdWUzJgoFsax6CzdMXdzB/A== X-Google-Smtp-Source: APXvYqwmQXLi5Pk3pGhuyO8qiBBiKgdkX+g+szMSnhLqCYqNltxbT3SHmRFeIwEaMyQpArp0jmo8vQ== X-Received: by 2002:a63:c60b:: with SMTP id w11mr5685117pgg.356.1561090179984; Thu, 20 Jun 2019 21:09:39 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 23sm958498pfn.176.2019.06.20.21.09.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Jun 2019 21:09:39 -0700 (PDT) Date: Thu, 20 Jun 2019 21:09:38 -0700 From: Kees Cook 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 Subject: Re: [PATCH V33 27/30] lockdown: Print current->comm in restriction messages 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 Content-Disposition: inline In-Reply-To: <20190621011941.186255-28-matthewgarrett@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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