From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0DE2C43613 for ; Sat, 22 Jun 2019 00:05:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A60CD20881 for ; Sat, 22 Jun 2019 00:05:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="q06PmHHA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727026AbfFVAFQ (ORCPT ); Fri, 21 Jun 2019 20:05:16 -0400 Received: from mail-yb1-f201.google.com ([209.85.219.201]:33345 "EHLO mail-yb1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727015AbfFVAFP (ORCPT ); Fri, 21 Jun 2019 20:05:15 -0400 Received: by mail-yb1-f201.google.com with SMTP id r142so7500241ybc.0 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=SPZmS3Djs7sVtd3T8eZ/ZmGG+IjlOzEUnnOXi4UXUaVcGf4xKDJmCe7jPH2i+QnFcr IdYzHux5Fl+/dqMcAVBCURlCLUbYlMv847rNMp7G7VGbPyDhnXGAr+S2XM8x2+/25EQ3 rkFxfuRGZ6IOqgQyEj8XGXGzUA0ul53rsZkQbANxQ66/9kUq4a3gbsMA1LJZZ630ftzx G+hNVEoqvFNvPLwMyBSFcPfl6osatvcvITT4c1Ju7+xzuX7f/w9KDdbXewYK1wzuFZ9i nyoIxZS5pKavingBjFfet/ud5qsvawH0CeG/XpLzW+5TTX1giXbU4MrdOEc28YGRyEGg aXDA== X-Gm-Message-State: APjAAAVzeClaekP6DLsQFUH2qhdINsZfEKEIKiG6RwqJ1TRaF5BAQKi5 h+0bARXGp1EoyyVl5W+kq+NlNIDUuv2/Gn4GER5bBg== X-Google-Smtp-Source: APXvYqx0rJT/xsCfnjxZK3RmGHU80HzrJAKBuZfKmF8O1USWU2O+1jjIPs2JgaewKUvGu1xDrRZPouAlEqHIaNui4XSXmg== 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: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: 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