Message ID | 20230131063928.388035-14-ajd@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2592987wrn; Mon, 30 Jan 2023 22:41:36 -0800 (PST) X-Google-Smtp-Source: AK7set/7D07nOkd/ld8sNeoNd9QIByytdN4PHO+BWcm1/8XYIEm9A5C2Pd2luGB9oKaJbuaYqzMX X-Received: by 2002:a05:6a20:2d99:b0:be:e7c9:c31d with SMTP id bf25-20020a056a202d9900b000bee7c9c31dmr828910pzb.49.1675147296251; Mon, 30 Jan 2023 22:41:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675147296; cv=none; d=google.com; s=arc-20160816; b=NOGwxo8aLBaEOs1nPUE0m1MRQ6zoze3aShJMUv8BP0GFDIzEDTBdfrfJAHtTEgqYP9 R4bXhMi49GGBSGB/5qz8CH0zaRyavSCupaSATa0O7UD2TzspIASg84MGWx5FH5GnSWoh L8uuxgR0WLrPMYof83JZACOvxsHIkrVry60u/U42tvfyxfUvxpXiv9B3Emz9pVjwdXhB YTzsUYC+BVyrf0b2Qx1At5cym7XDojMe/WZfoTsp0RuJPfEDf1Y8Q5/89Sx7XdKA+o4G 60o7fEwlE3zIIKGpzrdGly/dRX4e9aEa9HYG6ROr4k52915+IyWgIh1U59/PEaMczDLt 45IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=otnGpFY9MquFvFsvYoPp4smm+BqfHTn69RwFg0TJv9M=; b=KQYz7RqGAUt88vmlxqPLKeVp1EEs/wl9PCBxFvbMjxTSlBzPsz0sbCbn86SGGYr5lx gIC33kvk6b1zKqyoYc+pqtwxJttlqI9ePVTA3/Ha2Lbl2serrX35A0kUK/N4xlrWLTs+ MLjOW9A5gTXLXllMCykDFD/1AdchVF9nfiOJy4zBaqgQkgSQ2+dhA+AbIQghSPMTVfSF zf89zGKZPEC37tvRsasNb3bAo1PlIAdsH7og690Lpv0B3tcB0+BFQWpqdg6qgliDF9Zl oiroGilLVSXc0mu2lPLr6KGxuz/uZGXwvOzBAQQEWbsOy/ac3w914YQGfnFvQmFML/in /dXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=rJeUaFCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m10-20020a656a0a000000b004da5a1315a4si17140654pgu.137.2023.01.30.22.41.23; Mon, 30 Jan 2023 22:41:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=rJeUaFCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230514AbjAaGkn (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Tue, 31 Jan 2023 01:40:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjAaGkY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 31 Jan 2023 01:40:24 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A55E3D903; Mon, 30 Jan 2023 22:40:22 -0800 (PST) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30V6IWSw004085; Tue, 31 Jan 2023 06:40:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=otnGpFY9MquFvFsvYoPp4smm+BqfHTn69RwFg0TJv9M=; b=rJeUaFCqRJZ7d/6p+4WTGzyMuw9lWoRFfIlcalmOnFR0NU63G4l/cUFxaA1stPjupk5p mKkFGfDjAdfaPBCIg4fX9uBElgIW66YY8lIBuJ/lxtdndE/IetjGDq7OskxAMOAGKtAG 7RQdFzoj0tf/NdOOLdLLPgQjHbqxsvQtQxRNhWpA+3pbfakwlVGAN/rJjUBQNSh6f4a9 cl+dATIPJ6dM8UP95kWdBeK0fINiBY2UuXlzS+IrbdC17rvg9GOxlJiBtZnk9wyA/BGm 2uJktio0S8oUAFW+P2NIpR0vdwQDqdeo/BBO6uAKJRODYXKVCz5CKT4LDN3zI2ut5nj0 DA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3newkwgeyq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Jan 2023 06:40:14 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 30V6WNWx023597; Tue, 31 Jan 2023 06:40:13 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3newkwgexf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Jan 2023 06:40:13 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30UKWZE2012859; Tue, 31 Jan 2023 06:40:11 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3ncvtyb3h5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Jan 2023 06:40:11 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30V6e95F44695846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Jan 2023 06:40:09 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5BFD32004B; Tue, 31 Jan 2023 06:40:09 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D226320043; Tue, 31 Jan 2023 06:40:08 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 31 Jan 2023 06:40:08 +0000 (GMT) Received: from jarvis-ozlabs-ibm-com.au.ibm.com (unknown [9.192.255.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id B134860805; Tue, 31 Jan 2023 17:40:04 +1100 (AEDT) From: Andrew Donnellan <ajd@linux.ibm.com> To: linuxppc-dev@lists.ozlabs.org, linux-integrity@vger.kernel.org Cc: ruscur@russell.cc, bgray@linux.ibm.com, nayna@linux.ibm.com, gcwilson@linux.ibm.com, gjoyce@linux.ibm.com, brking@linux.ibm.com, stefanb@linux.ibm.com, sudhakar@linux.ibm.com, erichte@linux.ibm.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, zohar@linux.ibm.com, joel@jms.id.au, npiggin@gmail.com Subject: [PATCH v5 13/25] powerpc/secvar: Don't print error on ENOENT when reading variables Date: Tue, 31 Jan 2023 17:39:16 +1100 Message-Id: <20230131063928.388035-14-ajd@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131063928.388035-1-ajd@linux.ibm.com> References: <20230131063928.388035-1-ajd@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: _Uq7U4V3th2Ym66k5JrpOUsHjKelhk2u X-Proofpoint-ORIG-GUID: 30oN84RXlwGEBlmnl2Y7s0wEKyk879zP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-31_02,2023-01-30_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1015 bulkscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301310059 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756519251006297495?= X-GMAIL-MSGID: =?utf-8?q?1756519251006297495?= |
Series |
pSeries dynamic secure boot secvar interface + platform keyring loading
|
|
Commit Message
Andrew Donnellan
Jan. 31, 2023, 6:39 a.m. UTC
If attempting to read the size or data attributes of a non-existent
variable (which will be possible after a later patch to expose the PLPKS
via the secvar interface), don't spam the kernel log with error messages.
Only print errors for return codes that aren't ENOENT.
Reported-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
---
v3: New patch
---
arch/powerpc/kernel/secvar-sysfs.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Comments
On 1/31/23 01:39, Andrew Donnellan wrote: > If attempting to read the size or data attributes of a non-existent > variable (which will be possible after a later patch to expose the PLPKS > via the secvar interface), don't spam the kernel log with error messages. > Only print errors for return codes that aren't ENOENT. > > Reported-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com> > Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> > > --- > > v3: New patch > --- > arch/powerpc/kernel/secvar-sysfs.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c > index 9b6be63b7b36..ca3df3f7156c 100644 > --- a/arch/powerpc/kernel/secvar-sysfs.c > +++ b/arch/powerpc/kernel/secvar-sysfs.c > @@ -43,8 +43,8 @@ static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr, > > rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize); > if (rc) { > - pr_err("Error retrieving %s variable size %d\n", kobj->name, > - rc); > + if (rc != -ENOENT) > + pr_err("Error retrieving %s variable size %d\n", kobj->name, rc); > return rc; > } > > @@ -61,7 +61,8 @@ static ssize_t data_read(struct file *filep, struct kobject *kobj, > > rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize); > if (rc) { > - pr_err("Error getting %s variable size %d\n", kobj->name, rc); > + if (rc != -ENOENT) > + pr_err("Error getting %s variable size %d\n", kobj->name, rc); > return rc; > } > pr_debug("dsize is %llu\n", dsize);
diff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c index 9b6be63b7b36..ca3df3f7156c 100644 --- a/arch/powerpc/kernel/secvar-sysfs.c +++ b/arch/powerpc/kernel/secvar-sysfs.c @@ -43,8 +43,8 @@ static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr, rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize); if (rc) { - pr_err("Error retrieving %s variable size %d\n", kobj->name, - rc); + if (rc != -ENOENT) + pr_err("Error retrieving %s variable size %d\n", kobj->name, rc); return rc; } @@ -61,7 +61,8 @@ static ssize_t data_read(struct file *filep, struct kobject *kobj, rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize); if (rc) { - pr_err("Error getting %s variable size %d\n", kobj->name, rc); + if (rc != -ENOENT) + pr_err("Error getting %s variable size %d\n", kobj->name, rc); return rc; } pr_debug("dsize is %llu\n", dsize);