Message ID | 20230210080401.345462-4-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 s9csp820914wrn; Fri, 10 Feb 2023 00:06:47 -0800 (PST) X-Google-Smtp-Source: AK7set+FRoy0XyZzXpaIKao8WGy8wA/PA7hCl11SXurhY5oxCb++v3zliqc3y7FyXdf8uxqUmR1Z X-Received: by 2002:a17:906:3950:b0:887:3c7e:5df with SMTP id g16-20020a170906395000b008873c7e05dfmr15916450eje.73.1676016407606; Fri, 10 Feb 2023 00:06:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676016407; cv=none; d=google.com; s=arc-20160816; b=qe/dkiYeOnXvK/9RoaeK1jhPrYTyV8SxUPh7K872lN6APAIhOCgLM5QfCUDl6cs7KI bAby3jcbHVmHQ04iuGrFurUlogzX3qVgLdzycAgfDcA/rfesEpBn5d/R7KrGINF9MBmk wNiX3l2FsQZjpuL0DdvvVo8KicbaKmO07OCDLRUDdp5NT/L39AUj4zDsjyhbzj9hRgCV jmAJcs+2kcpsay3lNzTu8/RT9/nwS1Ad/taybEcIQWbZhatJibDkjm8CrQyAu+OR6oxF 8JJeq4ba1fQAE8hXgY/SlIT1pKqpn5cHIXvURQW/VoEVlMBCUM3kqX78JHO7MCRJ8thE FtXQ== 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=vC9JVreK0+6SnIM1kW+akAGKStkqNb5m8QZGsYb6oRQ=; b=p0hNCQ4XQJ9CoOCHG/OEHSgJ8o81y1rY24JZmcfWKxLJnvDMT7V5G5A3dy/suMFyZt 3dJKDv6rYJUqa3gKzQORTL6rWgA0g147gHaDkHABQcKqdwqyRtTO6mQ1dYibFdbZq27v TDrWz0oKgWtjtIl08Qfr07qYhkOk9RkA5a/yXOrBIUMEPckduLiRbBLzdEFG6AUTUkfC zsgUW8QA1boNDgOB2WsfGO0Smwr0fS/QZoM+lrIhy5Iqfnh/TOl6FnFLIHJwcPupS+ou OBEt6LyuQDUNbeOKidOG/Zfu1G8Crx3RWg/SS187ddruzwKGBRyA2uB/7MrwswDo4KIk X8qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=iF32a+a7; 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 vw16-20020a170907059000b0084d2eb17555si4322251ejb.579.2023.02.10.00.06.24; Fri, 10 Feb 2023 00:06:47 -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=iF32a+a7; 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 S231579AbjBJIEy (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Fri, 10 Feb 2023 03:04:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231524AbjBJIEn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Feb 2023 03:04:43 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD07680749; Fri, 10 Feb 2023 00:04:34 -0800 (PST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31A80gQH002883; Fri, 10 Feb 2023 08:04:26 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=vC9JVreK0+6SnIM1kW+akAGKStkqNb5m8QZGsYb6oRQ=; b=iF32a+a7DKK2eRZwk44Qz6e3KkdinkVopGSbOcHv0tXuG/wSaiDbDds4w3MR1cmd0fWe jEhQqK9v2EPj13i9RHkv5JB8Fvpq98/1SP07N7pWjZayWOABkha8Ywc0oBhGEVG61i8s MMB5hDrk6AhucNZDA5ZAFIlTCFsgwz/RBsXZ1Bs7MYs2N63bQ7DvqyLK3SJDNSqGcidX VDE77SlqrnFb2JPjEGAv+SDKp/QHua/sVFBxO6Rx2gBr3hM2W8Im22wWR990uJLCfL5b Z5XhEWwvqpKojiJ+H72Cmrdlb7hNI3tJCEnSLfr1wLjHZ8kZN/UzeApnNunC81YdYg+P 2A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nnj1r0324-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 08:04:25 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 31A80bYc002184; Fri, 10 Feb 2023 08:04:25 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nnj1r0311-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 (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 319L92V2017164; Fri, 10 Feb 2023 08:04:22 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3nhemfn4xt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 08:04:22 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31A84InM48038308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 08:04:18 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 35C2F20040; Fri, 10 Feb 2023 08:04:18 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A50E12005A; Fri, 10 Feb 2023 08:04:17 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 10 Feb 2023 08:04:17 +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 B3651606E7; Fri, 10 Feb 2023 19:04:14 +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 v6 03/26] powerpc/secvar: Fix incorrect return in secvar_sysfs_load() Date: Fri, 10 Feb 2023 19:03:38 +1100 Message-Id: <20230210080401.345462-4-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 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 4rZK73IOMvncDToE6M0FGvGxRIExe48l X-Proofpoint-GUID: sriUhezUdM1NeZLbQwLNNHhLIroukkeL 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 spamscore=0 priorityscore=1501 phishscore=0 impostorscore=0 bulkscore=0 adultscore=0 suspectscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 malwarescore=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,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?1757430580667944423?= X-GMAIL-MSGID: =?utf-8?q?1757430580667944423?= |
Series |
pSeries dynamic secure boot secvar interface + platform keyring loading
|
|
Commit Message
Andrew Donnellan
Feb. 10, 2023, 8:03 a.m. UTC
From: Russell Currey <ruscur@russell.cc> secvar_ops->get_next() returns -ENOENT when there are no more variables to return, which is expected behaviour. Fix this by returning 0 if get_next() returns -ENOENT. This fixes an issue introduced in commit bd5d9c743d38 ("powerpc: expose secure variables to userspace via sysfs"), but the return code of secvar_sysfs_load() was never checked so this issue never mattered. Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> --- v5: New patch --- arch/powerpc/kernel/secvar-sysfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c index 1ee4640a2641..7fa5f8ed9542 100644 --- a/arch/powerpc/kernel/secvar-sysfs.c +++ b/arch/powerpc/kernel/secvar-sysfs.c @@ -179,8 +179,10 @@ static int secvar_sysfs_load(void) rc = secvar_ops->get_next(name, &namesize, NAME_MAX_SIZE); if (rc) { if (rc != -ENOENT) - pr_err("error getting secvar from firmware %d\n", - rc); + pr_err("error getting secvar from firmware %d\n", rc); + else + rc = 0; + break; }