Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4040589ybl; Mon, 3 Feb 2020 11:21:54 -0800 (PST) X-Google-Smtp-Source: APXvYqylYsg77sk1QHvb9a5jsRHR5i69dsU0SJ6NoOUoRkhqHZyryn4cxhAaciZgryGqaB7YfUwY X-Received: by 2002:a05:6830:1305:: with SMTP id p5mr17830657otq.124.1580757713971; Mon, 03 Feb 2020 11:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580757713; cv=none; d=google.com; s=arc-20160816; b=F6dC7o4YAxBN/ugdXRQLeIoTt4qn4PJovqBPRnzTIAKQZcN/o1o7rSsU8o39Wj+VN6 evUamoES/XBCKiegWECsU/Kw9M1zXgJoT0HgzYhtfQBYru0suND2nQ/432U3a5AzgLGM dQanf7gqh54fRkIha2nLynVNZ9IH+MdKi8U3MqojZzYNSVhaLt/Q2EZO4NjXKb0qjdsO /zJTQFx/5Sz+e4RfNUwLV0/sBZ2fwNlZqTq3J3JWzK4xYkiLRhSwgbR9ezn4vVBNoXqB OuDmTumZ8ilG+zEJX7sJquASNrd9dforcTX6XCuvNozo4muu6kSaGNtYDwQC3wr6jkdV Vbzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1iYbXocdYEH5oXypfZqt5PJlhBuoAhxQfxeB0+Xy080=; b=iySlKq1Zx1snI2FS2JIcjQrwiI5IedPoploEbXadgm/GwBVk0tRBYXyjYD8NJQHfhu fwi/MFrj0OvI7j88ancTbW1tiYpVsHNKS+Mh7qr05LhOyp0URQ6J2CUHLjdsUVBl+MdE fsgK9IsPuHRI8rVj1VuOnok2KH4dSeSmeLhj+OX7tqloItwWyS8bq9Q1QBslFcMv6/7B eogc+JcgGF7bIUQqTFNrEJug5pNKl9HNBZhXs7oTqQJ8rRj/EkmFg8U3wJa2Szdf6WB5 trEi5X0i5wslKmk+rutEsia6RCQQG7WJR1SxZe6rks2U41V0uSe1yXyOc/OnvvCXo89P 9M/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=FAdsYDdZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si9639970otf.178.2020.02.03.11.21.40; Mon, 03 Feb 2020 11:21:53 -0800 (PST) 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=@linuxfoundation.org header.s=google header.b=FAdsYDdZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727063AbgBCTUe (ORCPT + 99 others); Mon, 3 Feb 2020 14:20:34 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50231 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbgBCTUe (ORCPT ); Mon, 3 Feb 2020 14:20:34 -0500 Received: by mail-wm1-f67.google.com with SMTP id a5so552462wmb.0 for ; Mon, 03 Feb 2020 11:20:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1iYbXocdYEH5oXypfZqt5PJlhBuoAhxQfxeB0+Xy080=; b=FAdsYDdZy/1yVlA4TnSFFPrIm2korvILQmMzZsUShxMMlQGhr/ZdcH1TQ6UyIfTLa1 f/dY5ZzaGo/SS61bFP/sHBavu9M7SqJ9fsl69n+AgVgRyc9gVzaKynBVEk1wqhyNkdSD ebYvs+EpTvcDdBMHyZSgUadxDzOhZE2VT6neI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1iYbXocdYEH5oXypfZqt5PJlhBuoAhxQfxeB0+Xy080=; b=YvUmwskylB/BC3evAJMZ42hGSapNxjsoeVzdpRjLP4UrChDep6XcVYtKqtDegIlooK HNezp/2rE5gZ2w5YFCDfcGs1jU9IP+SGJvRAjma4XjBWUlL2z+IPA6zpTiv0VqAAqobd TkNGSW2vyCJHDkWs4clPK6Nm7QraiVpozizLMncXPpcYq4wG7zxAaj5sGmbzoU5qfX1K hPzBdeTNpAYDHzqzGHXPr3a7Jm2lMcfqvISVXPf7tWt2dzB4FqVLicGC11DUiDGWyJml 29p6rIW7ZVFSfUBdFxsWL46w5SUiVsPYAZGyzpEXlAKujbeMZi1/aXXtBw+zKIoeP9gP 1yCA== X-Gm-Message-State: APjAAAWTJfKN77ywuuxiYIvyN5RByKKJej5INZO+NOlA/nzxb8Uep8gV N8atY7ckXVpZxNyCgkU0Xdgc5Q== X-Received: by 2002:a7b:c5d8:: with SMTP id n24mr543964wmk.124.1580757632086; Mon, 03 Feb 2020 11:20:32 -0800 (PST) Received: from [172.16.13.174] (host81-133-38-158.in-addr.btopenworld.com. [81.133.38.158]) by smtp.gmail.com with ESMTPSA id 21sm453824wmo.8.2020.02.03.11.20.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Feb 2020 11:20:31 -0800 (PST) Subject: Re: [PATCH] security/integrity: Include __func__ in messages for easier debug To: Joe Perches , Mimi Zohar , jmorris@namei.org, serge@hallyn.com, mpe@ellerman.id.au, erichte@linux.ibm.com, nayna@linux.ibm.com, yuehaibing@huawei.com Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20200130020129.15328-1-skhan@linuxfoundation.org> <1580736077.5585.4.camel@linux.ibm.com> <475ab05c-300b-fdbe-5de0-6fce8d1a360d@linuxfoundation.org> <94cf0aee8fd8b78718e252488458cfea105c0469.camel@perches.com> From: Shuah Khan Message-ID: Date: Mon, 3 Feb 2020 12:20:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <94cf0aee8fd8b78718e252488458cfea105c0469.camel@perches.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/3/20 12:02 PM, Joe Perches wrote: > On Mon, 2020-02-03 at 11:55 -0700, Shuah Khan wrote: >> On 2/3/20 6:21 AM, Mimi Zohar wrote: >>> On Wed, 2020-01-29 at 19:08 -0800, Joe Perches wrote: >>>> On Wed, 2020-01-29 at 19:01 -0700, Shuah Khan wrote: >>>>> Change messages to messages to make it easier to debug. The following >>>>> error message isn't informative enough to figure out what failed. >>>>> Change messages to include function information. >>>>> >>>>> Signed-off-by: Shuah Khan >>>>> --- >>>>> .../integrity/platform_certs/load_powerpc.c | 14 ++++++++------ >>>>> security/integrity/platform_certs/load_uefi.c | 17 ++++++++++------- >>>>> 2 files changed, 18 insertions(+), 13 deletions(-) >>>>> >>>>> diff --git a/security/integrity/platform_certs/load_powerpc.c b/security/integrity/platform_certs/load_powerpc.c >>>> >>>> perhaps instead add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt >>>> so all the pr_ logging is more specific. >>>> >>>> This would prefix all pr_ output with "integrity: " >> >> Joe! Sorry for the delay in getting back to you. >> >>> Agreed. Joe, could you post a patch with a proper patch description >>> for this? >>> >> >> I have been looking into this a bit more and there is an opportunity >> here to add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt to integrity.h >> and get rid of duplicate defines. > > That might work but: > > $ git grep --name-only 'integrity\.h' security | xargs grep pr_fmt > security/integrity/digsig.c:#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > security/integrity/digsig_asymmetric.c:#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > security/integrity/evm/evm_main.c:#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > security/security.c:#define pr_fmt(fmt) "LSM: " fmt > > Here security.c already uses "LSM: " > > Does anyone care about the LSM: prefix? > > What I have in mind is replace the ones under security/integrity/ adding the define to integrity.h is under security/integrity. I would leave the security/security.c:#define pr_fmt(fmt) "LSM: " fmt alone and just replace the ones under security/integrity/ in which case KBUILD_MODNAME will show integrity as the module. thanks, -- Shuah