From patchwork Thu Feb 28 23:12:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Garrett X-Patchwork-Id: 10834247 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 371991880 for ; Thu, 28 Feb 2019 23:13:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2887B2FC41 for ; Thu, 28 Feb 2019 23:13:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CAA52FC45; Thu, 28 Feb 2019 23:13:35 +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 C6C842FC46 for ; Thu, 28 Feb 2019 23:13:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387950AbfB1XNQ (ORCPT ); Thu, 28 Feb 2019 18:13:16 -0500 Received: from mail-it1-f201.google.com ([209.85.166.201]:43549 "EHLO mail-it1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727866AbfB1XNP (ORCPT ); Thu, 28 Feb 2019 18:13:15 -0500 Received: by mail-it1-f201.google.com with SMTP id w200so9784304itc.8 for ; Thu, 28 Feb 2019 15:13:15 -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=7o31AusohNb959PRfakB/D1YmTnIqZCzH/ljQnTAp4Y=; b=oMSabQYSh5BEnjbYGEt+9TN7Xn+nTrX7vyeNAkn7Hg7wqae8z2ha9ZxQUgPwIa4uOT D9EqfjspaqUQMQD9DR0P64E7c6/9e5DTMbgrejyEbgKt8/B2ED1B2AfeToabME/vKcJS F1s2URj9svBxho3mIVh7eI2Hh0m1OzlMX3SwFyWICfJ3RBuyZUo5kQC+PhEEiHyqWCVK 92QW9m+UzGGHovCtmYgAEoRQsDilDe/a2lqHWWKbGmKCrI+VFgd8IOQR7iOqB+vAN4fb P3tFWNnSXJ2+GjPS14Xl0ue2sairI2sv5DUJIqT1o7fqRGM1PNkKwcYFw//QEsu3B8ib iT6Q== 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=7o31AusohNb959PRfakB/D1YmTnIqZCzH/ljQnTAp4Y=; b=Eeccvzz9a3TvgwPZOFTgImB9wjXZF9SAWxN0p0dShffSNTimcXYhYpgy7kdcKJ067u BS6N0rs19oOcVubHuaTl4uq6tCD8yqzpWni5XRhf/To9SFpgFh1FoSOf8D6WkAHm6+31 R/+K+ugK6cGQztsIF7nlCnYyDpNTou6uAr2Q0KPyef7gbk66QmdQ2POL07PpBl77OYz7 c8+JSLzffJa9V1ZBAtThtXdfNSG99cvDi/sPjNUhFfr7sxRFSop+h9JyuRbXVi1+4pE8 aMR8A2mtXwWMDstscEvLDXsUvP4O96YuMTdiFq9ZM8MOJro0YfHAKX9blT0RKm5ZbfGG z7Eg== X-Gm-Message-State: APjAAAVOHBHEF+Ju7Ulxa2qXqOa6W1Q1hanlOZGLKofHZJ3J0AnuasDn u7317QNjlw2IfLxBqsL8gvyWn8ugt024prqfGd5jRw== X-Google-Smtp-Source: APXvYqz85FIjQCIycs1HBz9ec4dvIvyrWTRZIyhimnBeV4YZuCRUEi0ZSjJmX6p4cWT4jfxZgD/dNItVttOpZKRT+49geA== X-Received: by 2002:a24:5dc9:: with SMTP id w192mr1465559ita.33.1551395594739; Thu, 28 Feb 2019 15:13:14 -0800 (PST) Date: Thu, 28 Feb 2019 15:12:03 -0800 In-Reply-To: <20190228231203.212359-1-matthewgarrett@google.com> Message-Id: <20190228231203.212359-27-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190228231203.212359-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 --- 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);