From patchwork Fri Feb 10 08:03:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Donnellan X-Patchwork-Id: 55293 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp820937wrn; Fri, 10 Feb 2023 00:06:49 -0800 (PST) X-Google-Smtp-Source: AK7set+ckDvukIVcFA2ZtCgnYc1Ii7Cujg9BForLI87Fqsxd51dNHRQUG11WGEUuxn+TzmkxMYVA X-Received: by 2002:a17:907:2104:b0:88d:697d:a3d2 with SMTP id qn4-20020a170907210400b0088d697da3d2mr14091805ejb.54.1676016409807; Fri, 10 Feb 2023 00:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676016409; cv=none; d=google.com; s=arc-20160816; b=hTFmvCVWcPkm+hN5fvdskXNWH3uZ2Zp4hAceqWILdC3qFJEwHcQKt2Nr2rLoXSVJEG rH+4eIyKhUwxS7N4t+pyW2r2SCmlpjihmAA6PRONB3ylAEH6dMKDKMyhqNA0CcsHP4kk s5ZT7OX51H/5BeOV7RESJ1z4gfRPr4CX0W1jTbTXQq8g+TZW2qUA2opcfvgSnYxZmuZL ccOwQga+sXUwA7ALn3ru3z8rk9fCx61TotFVawN0x13lXRTFkvsAuYWwIcoPNh01swf2 2gfaG/jT0WibOmRfVC3rsQVMX/CMtxn/NRb/AnzkKlVkoW+n/BIl5grv89o9PTkP+NM1 tSWg== 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=6RkPafligA6B+YzStqIbqDRp7JI1Hfw2d/onHYoGAx4=; b=mCNvWTpadzF5UQvB3nZ9/6N1/8Jb4d/2iZ1VIJryjl1ztPhw7iOI4ttIeZVkgWOmYR SZFl+KnLOX73sdu6clJmeMYhfPZzLBYSw2ea8VOv0OPENMGAqqlpnx0pS6rC/iTqNgfd bbHZGdYho7MCm4o+x43cyqTiyO6JZ09nWnMMKMg6wkDa0CZi/v6upGO7S6i5iklt7hEC Dk+97qgVHb5iPRWm0GObCzr+CSAU8S9HPEzHZP7JSzdfbHxXmLDaVqRf/EaPMJHRW/6J V8EyCmNWsPd2Y7HuCh1Mq3YoWGhwFhRu2MHNWdy+Jw3DCgAuU0QIEdMzAuxXHMFcKSfd dKog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ddghUGUK; 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 fp17-20020a1709069e1100b0088c3a872136si4053576ejc.693.2023.02.10.00.06.26; Fri, 10 Feb 2023 00:06:49 -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=ddghUGUK; 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 S231612AbjBJIFK (ORCPT + 99 others); Fri, 10 Feb 2023 03:05:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231569AbjBJIEv (ORCPT ); Fri, 10 Feb 2023 03:04:51 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494F280772; Fri, 10 Feb 2023 00:04:36 -0800 (PST) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31A7hGNh006808; Fri, 10 Feb 2023 08:04:27 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=6RkPafligA6B+YzStqIbqDRp7JI1Hfw2d/onHYoGAx4=; b=ddghUGUKO911Q3wfgJSO6yfv0+tC3KLeKC+cprCbiE7FoUxr8SgsXnaP4TDukhJHMnHR UzQMX/bnvc6eRP/wILEH231wqgGis/Rbe/kZoJFrX4j3Vf99SAxb8AJQAF8p1s8GeFsC UAJJ/bhNJvYKK9pi/8k0hfa2qwXt5utl/ITajf8ic1YDNA7dgBh21RESBe4i9dGL9QjB HcWiaI/5ZJVMwxwBPIH3vcyyFGyPDTMZ7OUzdQM6mD2w1zYFDjaywaKBVVqJOQj7oOB3 4W9P0c0D5v1KROLjueCwf8YF55sJzHdyKWzI78NyLJCQBlaWa1feBEUgH1/XDeM251BW 5w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nnhsjrhnu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 08:04:27 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 31A7lVKv022488; Fri, 10 Feb 2023 08:04:25 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nnhsjrhmn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 08:04:25 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31A6FcSh020984; Fri, 10 Feb 2023 08:04:24 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3nhemfq6cc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 08:04:23 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31A84LbV22610276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 08:04:21 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3204920040; Fri, 10 Feb 2023 08:04:21 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A214F20043; Fri, 10 Feb 2023 08:04:20 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 10 Feb 2023 08:04:20 +0000 (GMT) Received: from jarvis-ozlabs-ibm-com.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (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 46DED6096E; Fri, 10 Feb 2023 19:04:15 +1100 (AEDT) From: Andrew Donnellan 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 v6 13/26] powerpc/secvar: Don't print error on ENOENT when reading variables Date: Fri, 10 Feb 2023 19:03:48 +1100 Message-Id: <20230210080401.345462-14-ajd@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210080401.345462-1-ajd@linux.ibm.com> References: <20230210080401.345462-1-ajd@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: qkh-ENGpZZfeRl5nFMZ5iqKYoQF2Dlro X-Proofpoint-ORIG-GUID: YkWXcUUTfGWKSfQT7UMzOWmM5f7nSl5O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-10_03,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 mlxscore=0 clxscore=1015 mlxlogscore=999 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100070 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757430583152598799?= X-GMAIL-MSGID: =?utf-8?q?1757430583152598799?= 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 Signed-off-by: Andrew Donnellan Reviewed-by: Stefan Berger --- 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 6ba23b2bb9da..eb3c053f323f 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);