From patchwork Mon Mar 25 22:09:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Garrett X-Patchwork-Id: 10870197 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 DEF831708 for ; Mon, 25 Mar 2019 22:11:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C586F28C1D for ; Mon, 25 Mar 2019 22:11:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA09D2905C; Mon, 25 Mar 2019 22:11:22 +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 6F2C628C1D for ; Mon, 25 Mar 2019 22:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730187AbfCYWLV (ORCPT ); Mon, 25 Mar 2019 18:11:21 -0400 Received: from mail-pl1-f201.google.com ([209.85.214.201]:45644 "EHLO mail-pl1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731238AbfCYWLG (ORCPT ); Mon, 25 Mar 2019 18:11:06 -0400 Received: by mail-pl1-f201.google.com with SMTP id e2so769918pln.12 for ; Mon, 25 Mar 2019 15:11:06 -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=5iSVCneQgilycqdqj85O1X6up5O4FEWFZBNwHvOvXOE=; b=L6UspPUU7LpZxMcfbvoaI7Tg2n4+p8fNP0UIxntKJjFcQLBoyhSwOBNbR2F8mzIaKp GIFYVoLj5UCHQLKPSNOy9yizp0XrUg8UzwGIp2+slwke4lpHQBDSdlO5NoKjSnGbCR7h uF7pOgqEe/fSBZncHMy/19wRFDRB2xiQpMA2Bo9V9y/dbESDO0ppIPZB8X72vddRlLHv XSdbSQNs39ZB2osRt/Bxw8FB0kw1KzhihnVnv/26GrLdvgR7Ew+92pmiw3Ojs2WIShPf C3QQ7cCi0EqgtReJFWC6heAf48COoTMjjKW/xEQj+2JB5C9NfAEGtD8DQcTdpBZehENr fokA== 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=5iSVCneQgilycqdqj85O1X6up5O4FEWFZBNwHvOvXOE=; b=N5Rrcbt80KKTSTyJNAHhC4uNDcYSPyealsFRPBs8tsEWyfXM0e+2jgHQ1tf/RHhCmS KLja/abCJdx/fjWiIdwnoRxVc8rROttRKx2IhzQecMz2zOzyicjxn11NNR+zNhG+kOau gKrMJoXYn+SCQY2FlNX70rYOpi2qFRbwt5eug1jqMbA8Tqbh+KOc9ye5mUxWwnjnnSbL IG5qMueloExNcH6F3ryMh7JjRON7PztBYTgtRE/sLNZMaZgVJS6OoMap4zaOJVhhmiCE Up+U+TIH3jXpkkS3wjBHSE7zrB3Bh+wS47oUf2jbDeoJjqH+W6ltJHAgGaogAs6ovW09 QL5w== X-Gm-Message-State: APjAAAUva5rz/HgtW7zYAA+ZN9TtTNg305v12IF4umm7CvPvlcAjhgLA JDaWN46vjzgTp8GjQRXRal0POxc67d6cj/rxihS8xg== X-Google-Smtp-Source: APXvYqw/eS3XyvJZeawA1kpIC3m8aG+vdw0JhNVqktthhhxksycK7tomczkg1Fo70yGcLG+56LXYxzqHSIkSrhiDGbszvA== X-Received: by 2002:a63:6fc1:: with SMTP id k184mr13169649pgc.239.1553551866271; Mon, 25 Mar 2019 15:11:06 -0700 (PDT) Date: Mon, 25 Mar 2019 15:09:53 -0700 In-Reply-To: <20190325220954.29054-1-matthewgarrett@google.com> Message-Id: <20190325220954.29054-27-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190325220954.29054-1-matthewgarrett@google.com> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog Subject: [PATCH 26/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, Matthew Garrett 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 18d8776a4d02..ee00ca2677e7 100644 --- a/security/lock_down.c +++ b/security/lock_down.c @@ -53,8 +53,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);