Message ID | 20230120074306.1326298-21-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 s9csp65609wrn; Thu, 19 Jan 2023 23:45:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXtMbjivOVr0XS2fWUC2bRa8laDphRl2F8aUoggEu/03nNv7Ou8cDE3hOEnrovcn/pAIMxAs X-Received: by 2002:a17:90b:3445:b0:228:d1d5:5468 with SMTP id lj5-20020a17090b344500b00228d1d55468mr14452273pjb.25.1674200701627; Thu, 19 Jan 2023 23:45:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674200701; cv=none; d=google.com; s=arc-20160816; b=GpAYy1I10q91aFI2kkSaNyueQrpEuDs+B9srt45IBC5+JdJ9dpNq57I97pQAlqPD7z Ar2q2kCT7A67ZoUu6nBVG6WfhGEE4dSp7G/zQGDfsgNeH1pZSMqScIrmPgIBOWGImEwk fG//DqNXu+zRxK0V6qoNIPA6QgVwtFBXMREYfo+LMjWkfQQzgyI1p98Gy5Z9gU2N/Rg/ KuRo68Lk3+j5gIkqECfNWfLwhdynngpUeFmoS/E2rzzddPmTlIRbLjpO05/+mrmyclKA qg2xRt2u311vLPz8s5hSQ/1fwf0E69q04gWUto+b26Sf2RHwCs2fuupFixl+yNLS2Rz0 f2mQ== 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=NbAGOkJyKTdzGBUpPMnKfY++xIugD/a7G/Z7957aSpQ=; b=lftRSQn8rlgaoL5FT4fUURlA0xJpzyKA6Xk6cwSqH73eOoXHgvgUvOosa5bcp0RzgY CtBDIRoHV1+TXS6AIm8FhXuWTwk8/apnIuz0v6x3976R9BnbEsJc2vXAKHI7Pcf3lrg2 YzZVyRiLUS6IJu2ETJagiyEDUZsuVoe0c5QCs8owabInVkNRxtLNqsizUvTRjpOxvqKo j8jthnTB35/ex6oIjjM3AaF3i5pJD7XnLFkvXfheXVyHPfF5QMXvg3ft8+4bY4rqcnR5 T4uTtVUmPuZC7/+FzzQsoEEndeceMUUKwbwm4TQUE4xSOZRgBA5B2cLPH5LwnLWRiVNo Iplw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=TWnkXVIP; 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 bb19-20020a17090b009300b00228e80888c9si1880773pjb.14.2023.01.19.23.44.49; Thu, 19 Jan 2023 23:45:01 -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=TWnkXVIP; 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 S230484AbjATHo2 (ORCPT <rfc822;changwoo.m@gmail.com> + 99 others); Fri, 20 Jan 2023 02:44:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbjATHnv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 20 Jan 2023 02:43:51 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD13C819B9; Thu, 19 Jan 2023 23:43:48 -0800 (PST) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30K7cbDT012878; Fri, 20 Jan 2023 07:43:41 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=NbAGOkJyKTdzGBUpPMnKfY++xIugD/a7G/Z7957aSpQ=; b=TWnkXVIPabRootvpTUqpKly+LpldIwRJlXPCw0Arkurdtj3+CabtxDtm1A3n0mw+dskt v2RENRC7ln44bF6qmXFO7xyMPKVUhebSuhKEZk1ZKgUxHIQUifLAgFxtplPP/Flx9Q41 nfvi9JJaGRamij4ICAGPeSjJMTxRKYqblw4Qbk7OKbSfLp7rDXZk1uEKPGZZPyC+r31j 4HW+4nlLoDYLGYsFTz4AS82q8UUn6abWAgNH7g1Aqvh4/dQUPPZwzu+SNsKmgpM4+1rn +8aEXDKCUCmzihyDIdSSqTlHrzGPRzFqpMJlmon5zoQvsC+3FXBf09lNPWpBus/XJyf9 FQ== Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3n7kvx3gvu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jan 2023 07:43:41 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30JM88kN001386; Fri, 20 Jan 2023 07:43:39 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3n3m16qnpq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jan 2023 07:43:38 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30K7haE715991540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Jan 2023 07:43:36 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 94CB12004B; Fri, 20 Jan 2023 07:43:36 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 19D1F20043; Fri, 20 Jan 2023 07:43:36 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Jan 2023 07:43:36 +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 4C3B060996; Fri, 20 Jan 2023 18:43:30 +1100 (AEDT) From: Andrew Donnellan <ajd@linux.ibm.com> To: linuxppc-dev@lists.ozlabs.org, linux-integrity@vger.kernel.org Cc: gregkh@linuxfoundation.org, gcwilson@linux.ibm.com, linux-kernel@vger.kernel.org, nayna@linux.ibm.com, ruscur@russell.cc, zohar@linux.ibm.com, mpe@ellerman.id.au, gjoyce@linux.ibm.com, sudhakar@linux.ibm.com, bgray@linux.ibm.com, erichte@linux.ibm.com, joel@jms.id.au Subject: [PATCH v4 20/24] powerpc/pseries: Add helpers to get PLPKS password Date: Fri, 20 Jan 2023 18:43:02 +1100 Message-Id: <20230120074306.1326298-21-ajd@linux.ibm.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120074306.1326298-1-ajd@linux.ibm.com> References: <20230120074306.1326298-1-ajd@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ojaWay5otVj4GZ229EavEN_0T4rm5W8y X-Proofpoint-GUID: ojaWay5otVj4GZ229EavEN_0T4rm5W8y 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-20_04,2023-01-19_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 phishscore=0 spamscore=0 mlxlogscore=783 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301200070 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?1755526675145208394?= X-GMAIL-MSGID: =?utf-8?q?1755526675145208394?= |
Series |
pSeries dynamic secure boot secvar interface + platform keyring loading
|
|
Commit Message
Andrew Donnellan
Jan. 20, 2023, 7:43 a.m. UTC
From: Russell Currey <ruscur@russell.cc> Add helper functions to get the PLPKS password. This will be used in a later patch to support passing the password between kernels over kexec. Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> --- v3: New patch --- arch/powerpc/include/asm/plpks.h | 11 +++++++++++ arch/powerpc/platforms/pseries/plpks.c | 10 ++++++++++ 2 files changed, 21 insertions(+)
diff --git a/arch/powerpc/include/asm/plpks.h b/arch/powerpc/include/asm/plpks.h index 0c49969b0864..08355c89f5fd 100644 --- a/arch/powerpc/include/asm/plpks.h +++ b/arch/powerpc/include/asm/plpks.h @@ -171,6 +171,17 @@ u32 plpks_get_maxlargeobjectsize(void); */ u64 plpks_get_signedupdatealgorithms(void); +/** + * Returns the PLPKS password generated by the hypervisor. + * Should only be used to prepare a different OS to use the PLPKS, i.e. kexec. + */ +u8 *plpks_get_password(void); + +/** + * Returns the length of the PLPKS password in bytes. + */ +u16 plpks_get_passwordlen(void); + #endif // CONFIG_PSERIES_PLPKS #endif // _ASM_POWERPC_PLPKS_H diff --git a/arch/powerpc/platforms/pseries/plpks.c b/arch/powerpc/platforms/pseries/plpks.c index 5d9c6a3b2014..b3c7410a4f13 100644 --- a/arch/powerpc/platforms/pseries/plpks.c +++ b/arch/powerpc/platforms/pseries/plpks.c @@ -359,6 +359,16 @@ u64 plpks_get_signedupdatealgorithms(void) return signedupdatealgorithms; } +u8 *plpks_get_password(void) +{ + return ospassword; +} + +u16 plpks_get_passwordlen(void) +{ + return ospasswordlength; +} + bool plpks_is_available(void) { int rc;