Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1238071ybi; Fri, 21 Jun 2019 17:06:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMFcPjwYzJ0hBsk2hpb6KPY/Zk05Jmjg2YU7FTJP9SQqe2aJWmaJi0f9gIRUdHB8Fsxg2h X-Received: by 2002:a63:cd52:: with SMTP id a18mr18247043pgj.351.1561161972783; Fri, 21 Jun 2019 17:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561161972; cv=none; d=google.com; s=arc-20160816; b=nBvZQwH6FXbQhAKuJCy2sdjlzbI5YJepDz2Tt904bYs8/ukBxTWv3F2uyoYH0BmCaN mx4yg2mvg+x3f6o5fmayP9UVYW+zwhw6LcNrRPuE89FjhjqcN7DJQnESxEt5R4JJUdDD slIYX/77UrePHxuMhv3EXXY+zFe24vvWD6bfgb7AT/mzekkh0cuYL9Or6VTbg5QfK5wb UimeeyZEiBmasu96N+aOsu7/C1pxJ/XMOEMBsVYZaxZrMiCYPAG7exUcG6WpuE5t03ww 9T/QvZYdljeebvUQGTn6YX5FWwZCffnvvptPZPTxBPla7XOYKE/n0WksSttc5CjOOuVh /MJg== 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=fQS0pxsoBetP2Nwdi98OVtp/cm2t8DN7nKB4q9h9T/o=; b=h7tjzrZxr02zZTnWtAvq05dJBAMZQYf2PSzvm3rF94qaGdVNrSLuRv32y/IKcUgZYt iz9ENO0g6IYDBsJQ5KkRJPD/WfgqIu9nhwRnx6L+Xu9QQjvOXPPJZeESRbrrJoeV6cBo BxihXNyVnDOoKzEbZMOXrLUox8iC/h1aXxFlNNj8xL9zXW4hHaGilz/jlURj1EjxywlX ec7FSj9PXl9cOVSjdCE7yDD6UZzyZbcT9EWukBFhonmD+TX/KHmax2CBV6mJuQDaYj1y cW772Jcc1s0ZXdJC4tQ8iSoP55plWGKyYz//jLkSSCQ3fgACbfT23n8w5ZOhegmqX926 1sFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=q06PmHHA; 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 h61si3922420plb.256.2019.06.21.17.05.57; Fri, 21 Jun 2019 17:06:12 -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=q06PmHHA; 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 S1726539AbfFVAFX (ORCPT + 99 others); Fri, 21 Jun 2019 20:05:23 -0400 Received: from mail-yb1-f201.google.com ([209.85.219.201]:45982 "EHLO mail-yb1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727016AbfFVAFP (ORCPT ); Fri, 21 Jun 2019 20:05:15 -0400 Received: by mail-yb1-f201.google.com with SMTP id y3so7443174ybg.12 for ; Fri, 21 Jun 2019 17:05:15 -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=fQS0pxsoBetP2Nwdi98OVtp/cm2t8DN7nKB4q9h9T/o=; b=q06PmHHAEtmmhXeJ3zAcK/RQZC6ZOveSxcl6UVi4p4GE4munOy8zjRT6zd5POah6m8 qUUGJT6DOt1SF18EDdympILS6nRbXGXb3RoIhCMm/FJICtGrII721ONnz4vNcVZoP3Nu hiBh1dO7UkO1UVwF7JVcG0M8U6LUF7EAdCFqvrUGuxFqqF2cNBcbR+bwQPjgdsvzuYOb SD2HjQOo2EMZX0FY8ScuXYx2/5Tbldc/k5ukwSjy+86A6zZ1Xx7vF235sNZkl9Zjspqg BR8l3GCC4UH309ET+8MSJ4q0v7EDB51cTRUQo97fEIsDvlr5RsmrLleDNXJVE2xEbdzF aw0Q== 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=fQS0pxsoBetP2Nwdi98OVtp/cm2t8DN7nKB4q9h9T/o=; b=s285AFn4RYfV9H6uqt7Hit5uho3B+uS/9VshbSAvVvaa3seW/uQh5yAE3IFlAvdZiV RJyZYN3G6nm9X3ulT6idE1IPaMggGR8PMkJzQtoqz0odyB/ACoobH3yk+buKa5LLuKhU IPYi3TlCdJUDr+nEUdL9RdJdSp6CWMDPZ3pg7C3ptB3Nh0ZgQU6C0C6fOOBUc6Zdftwj N6yew1XmU0M2PPf8yN3S6MdW+7X/TZbkFLBa/FBLMiZGZdWuLkgU1PCjTekguIfaxtB0 X8w8xIO59vYyMC4F7crOazkVDM5iGyGHI1U5NXi6NPk6wOMtCWZUup6oPlF0nGzNWyPy uqpA== X-Gm-Message-State: APjAAAX4RF+B3bjzOjc4cunFP6ZcZcB9RBXPVUIg4jGdWHp/jkqV8Fs7 uv/GTTafqjBcT6Rksh8qJcOwH50VJ5Q7mFF3GppjWg== X-Received: by 2002:a81:a8e:: with SMTP id 136mr50270319ywk.301.1561161914742; Fri, 21 Jun 2019 17:05:14 -0700 (PDT) Date: Fri, 21 Jun 2019 17:03:58 -0700 In-Reply-To: <20190622000358.19895-1-matthewgarrett@google.com> Message-Id: <20190622000358.19895-30-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190622000358.19895-1-matthewgarrett@google.com> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog Subject: [PATCH V34 29/29] 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, linux-api@vger.kernel.org, Matthew Garrett , David Howells , 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 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/lockdown/lockdown.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c index 98f9ee0026d5..9ca6f442fbc7 100644 --- a/security/lockdown/lockdown.c +++ b/security/lockdown/lockdown.c @@ -83,8 +83,8 @@ static int lockdown_is_locked_down(enum lockdown_reason what) { if ((kernel_locked_down >= what)) { if (lockdown_reasons[what]) - pr_notice("Lockdown: %s is restricted; see man kernel_lockdown.7\n", - lockdown_reasons[what]); + pr_notice("Lockdown: %s: %s is restricted; see man kernel_lockdown.7\n", + current->comm, lockdown_reasons[what]); return -EPERM; } -- 2.22.0.410.gd8fdbe21b5-goog