Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5061953rwl; Mon, 3 Apr 2023 13:51:15 -0700 (PDT) X-Google-Smtp-Source: AKy350aYcWtS4BKwrtnj3JwdQBDlc5YgJeeqV8AcOGE/D4U4JDF9Pc3kVZ8FaGX+GxVEVGfuzKiO X-Received: by 2002:a17:90b:164f:b0:241:c25:14cb with SMTP id il15-20020a17090b164f00b002410c2514cbmr232305pjb.19.1680555074991; Mon, 03 Apr 2023 13:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680555074; cv=none; d=google.com; s=arc-20160816; b=zrJRnxgam6V7G1b9yqWzSgt5p2v7S5b1/ZK9SdgSCiMj/pcweNU9TbWHdxBBqJBvGs zLWKMpj0bkbfKmsolhcy9Zq3By2wBPdX/4yzFJKKHw2J7v1ecOBeBYeCoOp5fRMPEGQR WeBTvITKEtQlegF/5LAOm0KipAsn4reSUXXJ0zY3nLcG+QtijzP/SyqV2Uu+tP8ItjDE BGOmb7TEJdmEYKY5qDsmmf17l0rSvN7zafp7FUW07p2wF477VExfP/Bsfqw6x2M92Gjg qEBbSGDy5jv990XFdpaKnmldZ2uYzvHlC2T6w/xXLBZa0UTXgOWtDpfWisCLh7hhCXm5 X1Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=LkdjmCtGVb+5nxY71D+tZq13otQ52uuWmZ7dsuIAj1c=; b=ztifWTVmhYkHehcRa3HwOIEpzUKd3flfxjT1FOCkxbTIpLPnwpvE+lpDQlz5aGf1N/ iNmxD/Ceq1652s+fY2k+aTReYki5glYrFFN2NMiA2u4okwvPE4YytYCZY6lYS3Kuvx6T BjMTPLEvUq8A8FyyWkAtssIWwJt7B9tsbBPP6ITEARvgYgp9ugoAjEnqnb7bnivHEWnd pDSSHEeA+C6GDhsWFXJSXlgppyK+DGzg1qQ89epHXiGS4RDhukg5swq7ZCKW35WWtdbi KvZCjLFLsOvfjA36upApBn4vjkGZLxObrsxbGJ9nBFxR3E6zkpd1slLqU6H4qoUJqqpK sumg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DWUJ3dQI; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170903011100b0019c14335fc0si8177497plc.70.2023.04.03.13.51.02; Mon, 03 Apr 2023 13:51:14 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=DWUJ3dQI; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233424AbjDCUpK (ORCPT + 99 others); Mon, 3 Apr 2023 16:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233101AbjDCUpJ (ORCPT ); Mon, 3 Apr 2023 16:45:09 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE5E4139; Mon, 3 Apr 2023 13:45:06 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id a11so31710247lji.6; Mon, 03 Apr 2023 13:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680554705; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LkdjmCtGVb+5nxY71D+tZq13otQ52uuWmZ7dsuIAj1c=; b=DWUJ3dQI2iPjcNDJcSYgL9Y5UkWBk4E7r2GSZvmyHqDBVE1YxrmIlEokdoKZ+qG8Gx t7+mMOdSVXQkIyJzTf6c+kIPndI3sVaGCrS+/ajmXsfFtd2rcLTy7KHDAoqizf0pXWW3 WSFHsB8p0ZkQ0+mbEmn6wrfuKZ/ByLI941siSZMbH0OdkvnHg312U8o5O7KWYc+nKYO1 ZCUIJxo4uUlfwtR8r7Hu+nPXXEbVYvawtbORfXkHS2Mq2L0T3sPztK+cM2PZIuqiQfxP Xr++jrjJFx/kJeFWFhnToP1dBjC+/HUe5NP573pa5/JYRMkr/2IiJeZQJiK9my7D9GOW K2Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680554705; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LkdjmCtGVb+5nxY71D+tZq13otQ52uuWmZ7dsuIAj1c=; b=NMrwI23Tmhgl1PqeCivCiu9SBRTH5bLnJeD9dmDJxpSlNwkOeas/DIHqOgHlcNGSNT bXuTnRj1sLbW0bRQccX/EbLXRnCwcNQnJJUWdmdvEuSWoUbkRaJmxL0z+977N7vGFPLC i72Eo6Fr1U3C9LcCYsMC1e0jQzqPsz37XuS406ijBdc3XPlgqMlVcNO3jwgEayEzI9xZ KAu0tRycpTRtG2sLNa2wQdB85mD0FBusqhVT2+X46dK8Com0Ixzkj4CSuekPtuAcp/PH +wNeCXEZSsOOjfEPyOEIwE4d+59BKDUM/kZdHNZ/ydDk0bp+ScQLOpxcSL2AaWkFdM55 HoNA== X-Gm-Message-State: AAQBX9cMQfFfikjWpbdAnd1EhXuxq4S6TARoIZ0Kysa0dg5YCsgkZiul GPCZnGoBqvgf7mha6co8kWmnNW4Eia5obSkwVf0= X-Received: by 2002:a2e:8817:0:b0:298:b3c7:293d with SMTP id x23-20020a2e8817000000b00298b3c7293dmr274222ljh.7.1680554704574; Mon, 03 Apr 2023 13:45:04 -0700 (PDT) MIME-Version: 1.0 References: <20230309201022.9502-1-jorge.lopez2@hp.com> <20230309201022.9502-5-jorge.lopez2@hp.com> <6da33dcc-0526-4398-bf35-655b64d07e20@t-8ch.de> <3ca7fa3b-f0d6-4b63-bfe4-8a30197d7261@app.fastmail.com> In-Reply-To: <3ca7fa3b-f0d6-4b63-bfe4-8a30197d7261@app.fastmail.com> From: Jorge Lopez Date: Mon, 3 Apr 2023 15:44:46 -0500 Message-ID: Subject: Re: [PATCH v6 4/4] Introduction of HP-BIOSCFG driver [4] To: Mark Pearson Cc: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Hans de Goede , "platform-driver-x86@vger.kernel.org" , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Hi Mark, Please see my comments below. On Sat, Apr 1, 2023 at 7:48=E2=80=AFPM Mark Pearson wrote: > > Hi Jorge, > > As I implemented similar on our platforms I have a couple of suggestions = which may or may not be helpful. > > On Sat, Apr 1, 2023, at 7:58 AM, Thomas Wei=C3=9Fschuh wrote: > > Hi Jorge, > > > > > On 2023-03-09 14:10:22-0600, Jorge Lopez wrote: > > > > >> Many features of HP Commercial PC=E2=80=99s can be managed using Windo= ws > >> Management Instrumentation (WMI). WMI is an implementation of Web-Base= d > >> Enterprise Management (WBEM) that provides a standards-based interface > >> for changing and monitoring system settings. HP BISOCFG driver provid= es > >> a native Linux solution and the exposed features facilitates the > >> migration to Linux environments. > > I'd remove this paragraph personally - but as a minor note, typo in BISOC= FG > > > >> > >> diff --git a/Documentation/ABI/testing/sysfs-class-firmware-attributes= b/Documentation/ABI/testing/sysfs-class-firmware-attributes > >> index 4cdba3477176..d1ae6b77da13 100644 > >> --- a/Documentation/ABI/testing/sysfs-class-firmware-attributes > >> +++ b/Documentation/ABI/testing/sysfs-class-firmware-attributes > > >> @@ -126,6 +133,38 @@ Description: > >> value will not be effective throu= gh sysfs until this rule is > >> met. > >> > >> + HP specific class extensions > >> + ------------------------------ > >> + > >> + On HP systems the following additional attributes are ava= ilable: > >> + > >> + "ordered-list"-type specific properties: > >> + > >> + elements: > >> + A file that can be read to obtain= the possible > >> + list of values of the . Val= ues are separated using > >> + semi-colon (``;``). The order ind= ividual elements are listed > >> + according to their priority. An = Element listed first has the > >> + hightest priority. Writing the li= st in a different order to > >> + current_value alters the priority= order for the particular > >> + attribute. > > isn't this already covered in the 'possible_values' attribute - it's just= a string of items? Curious as to when/how this would be used instead of po= ssible_values (but I should probably read the code) > Typo in 'hightest'. Done. Possible values provides a list of values in any order. elements in Ordered-list list items in level of priority such it is case of list of boot order values. > > > > > >> + > >> + > >> What: /sys/class/firmware-attributes/*/authentication/ > >> Date: February 2021 > >> KernelVersion: 5.11 > >> @@ -206,7 +245,7 @@ Description: > > >> @@ -296,6 +335,15 @@ Description: > >> echo "signature" > authen= tication/Admin/signature > >> echo "password" > authent= ication/Admin/certificate_to_password > >> > >> + HP specific class extensions > >> + -------------------------------- > >> + > >> + On HP systems the following additional settings are avail= able: > >> + > >> + role: enhanced-bios-auth: > >> + This role is specific to Secure P= latform Management (SPM) attribute. > >> + It requires configuring an endors= ement (kek) and signing certificate (sk). > >> + > > Your implementation might be different on HP's; but on the Lenovo's this = was still used along with the regular roles - it's just the authentication = changed from password to a signature approach. > > Just checking that you really need a whole new role and that it isn't par= t of the existing role. > Unfortunately, we need a whole new role. > > > >> + HP specific class extensions > >> + -------------------------------- > >> + > >> +What: /sys/class/firmware-attributes/*/authentication/S= PM/kek > >> +Date: March 29 > >> +KernelVersion: 5.18 > >> +Contact: "Jorge Lopez" > >> +Description: 'kek' is a write-only file that can be used to co= nfigure the > >> + RSA public key that will be used by the BIOS to verify > >> + signatures when setting the signing key. When written, > >> + the bytes should correspond to the KEK certificate > >> + (x509 .DER format containing an OU). The size of the > >> + certificate must be less than or equal to 4095 bytes. > >> + > >> + > >> +What: /sys/class/firmware-attributes/*/authentication/S= PM/sk > >> +Date: March 29 > >> +KernelVersion: 5.18 > >> +Contact: "Jorge Lopez" > >> +Description: 'sk' is a write-only file that can be used to con= figure the RSA > >> + public key that will be used by the BIOS to verify signat= ures > >> + when configuring BIOS settings and security features. Wh= en > >> + written, the bytes should correspond to the modulus of th= e > >> + public key. The exponent is assumed to be 0x10001. > > > > I wondered if these could be combined with the signature and certificate = fields that I implemented for the Lenovo platforms - and those be moved out= of the Lenovo specific section and then made general (and optional) The behavior with Secure Platform Manager requires having KEK and SK separa= te. > kek looks like it corresponds to certificate and sk to signature? > KEK - Key-Encryption-Key SK - Signature Key > > > >> + > >> + > >> +What: /sys/class/firmware-attributes/*/attributes/last_= error > >> +Date: March 29 > >> +KernelVersion: 5.18 > >> +Contact: "Jorge Lopez" > >> +Description: 'last_error' is a read-only file that returns WMI= error number > >> + and message reported by last WMI command. > > > > Does this provide much value? > > Or could this error just be logged via pr_warn_ratelimited()? > > This one seemed odd to me too - doesn't the driver return the error to th= e use on a failed WMI access? > It was intended for debug purposes and to determine if the failure was reported because of WMI error. The WMI error is masked by the driver and the error reported by WMI is lost. for instance, WMI error 6 is reported by driver as -EINVAL. This attribute will be removed and replaced by pr_warn(). Jorge.