Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3663080img; Mon, 25 Mar 2019 15:12:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRLEIpPY+Wan6FoRpR1PF9bji8N1/RELP/LrRcnJHlpYVTaH/kEThnfit2YGmJOBByvSLH X-Received: by 2002:a63:6f0a:: with SMTP id k10mr3593361pgc.78.1553551948432; Mon, 25 Mar 2019 15:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553551948; cv=none; d=google.com; s=arc-20160816; b=AjTSrfh2JCf68dvas/nIiarliANgNTofcVoSWhDrYq19aVBJy6o0YdRkmMX+CmzVWR C+fsWmFId1G4W3E7PhzVvmNY7F+kRva7TVAiIo6KkMuzpolq+UaRdfCHJ38S5e5PJ5Y1 TP7jcRritqjLSNWEjpg7TrPV1/elYouywZny7OulKrz1sJsCxWqlgnKEvC8483nuvgnA dkpEHzh9AKdB0VLBahyAZLwYqBXq16DnGhFAlfXTu5Ew1envm2zGO4Uur7JatY3lFUZW TmbbwWDhjrJxfzh+6s/NCGJzw0H1xGMwp57ak8L+pwfefnsg1p1tuI6c8ZElL5syplfq EJmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=5iSVCneQgilycqdqj85O1X6up5O4FEWFZBNwHvOvXOE=; b=yUuETwIJtyG3gjvVWs5jD2siqibhydJ3zbG0gr6m2qYMRHAAbhntKcYo4alXnSDUOr c4zAlsLizHBsz8638vss0jr5437IF6lai79o8pUuzB8+CxjH4+BL9m3VqG9k9jxerqEG sQ464jC43W5uHOOdL8xHZyWOJmfX1zXIreI7ydT+J/DKGBESJCfAFPnA4zsq6pbJU4Gy uXLCGG9N1bG4/Lr7iefCREH/Y4fxinFl39oh0SGTMIO6j3KdGgRduQFoU0K+lWZfOuo0 Xn6bQ+xb05H6rILG067LQoVzpJ7Xv/ZMBcYnjccZt/7HHL2N1iPvBp3w1rcGqsIHUsZo wY/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=L6UspPUU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si13938742pgq.343.2019.03.25.15.12.13; Mon, 25 Mar 2019 15:12:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=L6UspPUU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731275AbfCYWLK (ORCPT + 99 others); Mon, 25 Mar 2019 18:11:10 -0400 Received: from mail-pg1-f202.google.com ([209.85.215.202]:45506 "EHLO mail-pg1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731239AbfCYWLH (ORCPT ); Mon, 25 Mar 2019 18:11:07 -0400 Received: by mail-pg1-f202.google.com with SMTP id f1so10371734pgv.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=CWavC+bub4KFhNH51+IZiW2LqDD0Db/iTFurHXA0w0r4jF3UT6p1Q+aanvHOTZVz3Q Qzx8d/esBGOoQbWrQPBnQUj4ENRV8wxll7dyg9FvVigifmsxQuvYqWiuYl2OlIyfUqPp 9SYLitxP8xKOToyeE3PSCZ0o1xDIQABN+40WwmXwyHLJuw7gkexwSmjrZ1NtUqoeUGml NWECQBR4csJWF+HjP15RJRy7OP5NK1lyuX6c+zRnvVlW36QxGCO/IwBujL00st4JrorF GkZ3rztIgpBG/rHbRDFGYq0pQiyZSbsb9DxOV8wCMTvXyyzK2t0xMgiRCjhaNEOIQOcp 2sEw== X-Gm-Message-State: APjAAAU20WW6SI76peW2zM174Bl31YBrfi3vxspI6oJtkgUfGTd7oHco BKmEGd+HDKTQSRnNBAcFbQdZOiNoaE4i+ARXhYS6ow== 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.21.0.392.gf8f6787159e-goog