From patchwork Thu Apr 4 00:32:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Garrett X-Patchwork-Id: 10884661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E959922 for ; Thu, 4 Apr 2019 00:34:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A1CC28913 for ; Thu, 4 Apr 2019 00:34:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DE742893D; Thu, 4 Apr 2019 00:34:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBD2128913 for ; Thu, 4 Apr 2019 00:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726337AbfDDAeW (ORCPT ); Wed, 3 Apr 2019 20:34:22 -0400 Received: from mail-ot1-f73.google.com ([209.85.210.73]:50589 "EHLO mail-ot1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728589AbfDDAd7 (ORCPT ); Wed, 3 Apr 2019 20:33:59 -0400 Received: by mail-ot1-f73.google.com with SMTP id r23so291829ota.17 for ; Wed, 03 Apr 2019 17:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=al58t6ANDPLU85eDCqgZCBVARE5LKCf1VFpj6vFxHNY=; b=OMHv1x1HxndU3NYmoUDmr9gQTnccB79SBkQfVDDbXGerRUffhKe6CcKdOi1Ir6U/wV 63pZmusqM4wrJB3yOIwud+H8z+rdBHLPiu2Nd2+CvehvZTx/coIYOejQtGpr5JFfvqMP MNj8GYj1yT0GExuZlz77AKMQyhlLsSMVTk5K7AYVMbxIX35vv6uMnYQvXU+tEVr0nFnJ y0NtltQc0YcLV2t1wBZGv+p05r+BoNoBrXxeT+rhmRkJs42rPYcHU7PUIFLfi6y18jM3 b2GRyv7mdMlx6fdRqiGL8NEZ942MHhJgDUsEAUs0AOwl3ctDo8EtN/OVpbri/oz+lrTG QiRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=al58t6ANDPLU85eDCqgZCBVARE5LKCf1VFpj6vFxHNY=; b=nNRzl/15bj5UMj6iRgqnntGkpDc/sNgNML+cAPPeZSZhmYJKDCVBlLJK+jYHrp2Sgk 6QhBmsMI9dxlnFkwnOZQ/sZ2xtnQfKHjI10GAR0MMGduMEENJ+RbfKlJdlDKc8DmwDyZ wPl6Xoruvp1k1Rm9C3U7VQzOxg3qqx1+ub09gnWucuJ2s4ZqPDq4jBzv/6x8R7C/yONo s207htMecX4efhmLYalUEklZDdMoz2Oiyejs58iX6w6uj/96t9tRva6lbk0PdA0MTrSI 9X2OS/4q4G4GZZTTfe0F2E7kxeJhbh57VGMSuG0SuWHYmdLaQ0/W6jhOnC88I736Rl3P W3vQ== X-Gm-Message-State: APjAAAXzU6lVYu6kQfa4jPNx3REBkPJW5GPli5oRWWMl/f84P22cWVXz qtpXfA9nfICPKq2PshRG2VsCnM6V3M2U3Iex9WRsdg== X-Google-Smtp-Source: APXvYqyTQMf0hBtIoJQxs48Z7EtRxQ4n5Sm6ALb5kg6yqoQOcbkRO5xTMllm9jjfwmqy/eZaXTvcifddpqNOzWmpA4lWVA== X-Received: by 2002:a9d:61d9:: with SMTP id h25mr264758otk.27.1554338038536; Wed, 03 Apr 2019 17:33:58 -0700 (PDT) Date: Wed, 3 Apr 2019 17:32:47 -0700 In-Reply-To: <20190404003249.14356-1-matthewgarrett@google.com> Message-Id: <20190404003249.14356-26-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190404003249.14356-1-matthewgarrett@google.com> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog Subject: [PATCH V32 25/27] lockdown: Print current->comm in restriction messages From: Matthew Garrett 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 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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);