From patchwork Wed Mar 6 23:59:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Garrett X-Patchwork-Id: 10842031 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 DE72E1515 for ; Thu, 7 Mar 2019 00:00:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBADB2E9F5 for ; Thu, 7 Mar 2019 00:00:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFA702EA0E; Thu, 7 Mar 2019 00:00:42 +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 7714E2E9F5 for ; Thu, 7 Mar 2019 00:00:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726121AbfCGAAl (ORCPT ); Wed, 6 Mar 2019 19:00:41 -0500 Received: from mail-io1-f74.google.com ([209.85.166.74]:40749 "EHLO mail-io1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726764AbfCGAAj (ORCPT ); Wed, 6 Mar 2019 19:00:39 -0500 Received: by mail-io1-f74.google.com with SMTP id 68so11056550iov.7 for ; Wed, 06 Mar 2019 16:00:39 -0800 (PST) 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=Sa+SgQnAHCfBo1mo2uJRDE5jhlzcMXQqHsZYr3YiEB0=; b=XHVjtwKczBVt6maHMDsBdQD040XvH2+tNtSVuU/nCfJ3PvcWW6Bmf9bvU+Tzoa+W4R FCbE0UrP5nNV1jU5XjJOZkqnPv4x8ko6PJzMBy4FlEKFmjjVjxqmkjJCAzcJTFvEnrsw Un33zXRpj5Edgxlf98Lt0dcO/fZfeodDmrbtLvSJZJUXfyz0FNW2iHBLnNV13g+qlrrT Nq6DCE8jBi4q/GiJCJ2yZyIcUV0AkF4YICved/SAe8Y82vMT0X5J2Gp4dWSpra1gXiOc s+QbGBDccRLIxR+/sSp8jSFkaLhOBcXALLPuavGxyzenZ2EnYEFK759MKEqj781jAqsV A0ag== 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=Sa+SgQnAHCfBo1mo2uJRDE5jhlzcMXQqHsZYr3YiEB0=; b=ni64pqo1AIveyN/HjyBYlgQrCB0smvCSA35NJi/2NBxsxbHvM4v9FsuAkGld//71sP lqdAZcZVtCYv1ZHtbw0nDYRJrtLn+GfHPEh/VHjoKjKMnDL/DXe6av144h0z0sIsBwNE KIJJHUe3PP3rD7QbnYP9QJKaHAE0JRzgYmjHOUGGWoKYtpPI+DRk+CrxaNW/BiUi2pgl tiipccfwiJfD3Ll5LhzwGwbic3YtTgJJOfQwkOhtGXHKf/Ipm/K2oC2ZrkTamn/ALeV8 zjKr7TLBUd+nAjlJJK5VyKo8uRd7bS3IcX8bswbp/y+VryRo3vd13Yd6qTwhGlwfFEDC 24HQ== X-Gm-Message-State: APjAAAVjjHrcvT+DXNJ8mpoHW8RzPOXdjbmj9HG6hMtEtQf5Gu2CoDkm 3hEAz6vzdHXtLLYkvJ/Y9z1xRIgDNq2/6S/6wYcTDA== X-Google-Smtp-Source: APXvYqwpf/k9ytvmRK8pEBfgH+rGfGX9tBiGZnv5J8A3JTXkOKnucGqv1lYF3oc3q6Kgmw5CV+qN08xhnulPEYAW9mB65g== X-Received: by 2002:a24:6cd5:: with SMTP id w204mr7949254itb.16.1551916838783; Wed, 06 Mar 2019 16:00:38 -0800 (PST) Date: Wed, 6 Mar 2019 15:59:13 -0800 In-Reply-To: <20190306235913.6631-1-matthewgarrett@google.com> Message-Id: <20190306235913.6631-28-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190306235913.6631-1-matthewgarrett@google.com> X-Mailer: git-send-email 2.21.0.352.gf09ad66450-goog Subject: [PATCH 27/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 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: David Howells 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 cfbc2c39712b..5243b55b3c1f 100644 --- a/security/lock_down.c +++ b/security/lock_down.c @@ -58,8 +58,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);