Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1075188rdb; Mon, 19 Feb 2024 03:36:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUJXJMLZDuspEfNVJqwQNen/Wj5x881uDfAeLd1BdFf2X93DsFhiVUrxWsukaWLfzSuJy8fHrfciUHWlJrjQRAldenXn27bSM/2jTIvcA== X-Google-Smtp-Source: AGHT+IG0wOSVSBDEesEs+8l2t6lTML0v8sLLhYfwvx3DfKsaxRjM9ykVh9Gu/B1VBbenQLfT82Zz X-Received: by 2002:a17:90a:be12:b0:299:58af:c873 with SMTP id a18-20020a17090abe1200b0029958afc873mr2798132pjs.10.1708342601278; Mon, 19 Feb 2024 03:36:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708342601; cv=pass; d=google.com; s=arc-20160816; b=t3va5o507M0bzapETP0Kqa8RrWGVYaYzIHojZKYpem3GjJSVr9C8En473rPypEouwc vjbbeX3txCeISjBnKaHuueOet72aVM65EKVaAOVwOHITKXdsrheX+I0ECTdO2WtlXxem hSGqPBDKeO+mTn5ZaEMV453DAViZw94ww9oWutJkHrzesFtPwTCemhAGgOeg1UiQgPee q9f3XODIh4cC9SLLu7gxT+zqnJ/FxlO0HGpPmQgg+ikERq6wu+aMMePxfa2HqgEUKACf 4z0dOMGyjdGS6DlMEJ2YLkRImdbvJCu2EbFjuRgfeO7YTYFNtednoISOcbweKehMVKi7 Wydw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=RaZBYDrNrWIpQuwZRoJJQwbTIgMqN6IhSLTRJ6ho8ik=; fh=Noigh+qgfE00d81stAs89wVdTHmFWhD67oggMBzgKmg=; b=jP/cQHewSycTmvouFUN8RnhgndWZnbtvhTcV5Zjv4lA1HRQ6aLdo0026Kqac/SUj1z PMNFhnmbyj3coqho1uFfTWWKjHMZZbpnxBMH9rLmGyOE28GYI0O/GT4WETB1I03lNSAx KXZ2vDbvPFKRVClekDtiEcL4KnfVdIQWFA24A6PdtRUM47oIDHsh2Xt0igl4xSRBtdbO LcKgZvka9FdnQTZAwgJihmwKH/ghV9dABAuUB+LOPWWkTunwFNxPzsWeqAKeZkG5bxTC UdtI4kI6E6djl77ki/WT4rW2nhpUoeaH3d0sZkmdOibIH9PuP8p74Y/75SPSwTx/DKly 52jA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KKuJsXLk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-71217-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w89-20020a17090a6be200b00298cdde79dbsi4344769pjj.154.2024.02.19.03.36.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 03:36:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71217-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KKuJsXLk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-71217-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F0BC4281726 for ; Mon, 19 Feb 2024 11:36:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 137DC2C6A3; Mon, 19 Feb 2024 11:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KKuJsXLk" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81B612C1BF for ; Mon, 19 Feb 2024 11:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708342590; cv=none; b=i1qZdJrBDrh+MQ7vkPKmYD8mmcH+28hIUURQkQqbfrSv1l1xbmYv+eXmlDZ5BcavIrTWMB5nGP20XPqgFZnsNKVNC6UHZhTt72I0jYwxDEBIlKi3Dk8JUzLNphPhlg733VGmlo9cDB2CF2KGsXMpPuyymf1CmwJWV1lY7P/cSRc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708342590; c=relaxed/simple; bh=EWkBavHLn+OopLzpvPPHkNXk/lsnfjFePZMUx0qJkqI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Lx81qaU42yMGI5Ax8lbinVQfqr6mTDagQa2Aoat2aXGRiRcJ1Ff0DiJbDizJTwmkCPk6AYQFsvCGT5lAJKmpKgR+pJMwenfjuajYWbMMsZJ4A3fEXSWdbNuiV0dZ3zdxw9mm0dTaKDqqrZRhHm0KOM68AaoqlPCwZx1Np/cStQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KKuJsXLk; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708342587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RaZBYDrNrWIpQuwZRoJJQwbTIgMqN6IhSLTRJ6ho8ik=; b=KKuJsXLknA/fuD/vGlDHaPD+uyf5SUc5UucQ72bMe+9o5boU54RqAELkCAG+JwAzGoeIHe a3xN9HqS5QfPFIT21C7pMYA3l5HKvkGvEVIMOSG41OvZpBMwAfES+penSPMgE7SNtswKgz pOY5DD9/afAI6wDz/A6GaghaWbMML0M= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-567-CM51Mj86Nmm-iGrUQn_J4A-1; Mon, 19 Feb 2024 06:36:25 -0500 X-MC-Unique: CM51Mj86Nmm-iGrUQn_J4A-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a3ed504b0a9so11954066b.3 for ; Mon, 19 Feb 2024 03:36:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708342584; x=1708947384; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RaZBYDrNrWIpQuwZRoJJQwbTIgMqN6IhSLTRJ6ho8ik=; b=ih8qkRcxcbJQBIAB3lWHEAvWBkbl/S5PEZVtNtTKxo3RUuZralG9zaip+1H7qCyplS V9qpNHt9hnWhu7m608KisTLAsYVnRwG5lJp7Fr5zmbR4OGv7GEeXn1gSjI4Npo05vqsO 0SnNFkmd6V9OI8TPUhmCDz1+iJSt2MyIINciPwvNux4NSHcflb9U7yB8dKKAzkDDelZX ah/CjoZWVX7KTMo6/+4TTYzEhNqoCUpa/NTqhmC5DvqplmA/HarDU5cAPYVxEMRl31xl RmJGvcqOuKKzbZ8jd2W6okr5NkWCWIK0nS45f1quGazH1o/ZvafAqO6t5XvqFMw3LOCY rj3Q== X-Forwarded-Encrypted: i=1; AJvYcCVXDolN09yglzljXDl3FupScnSTWoh8gU1nHXNm5KaaOAPue1gzWNjyG/AysvmPdOUHQvRZZRPk5ymNCRIxm+og4o7OKicr4191J9f2 X-Gm-Message-State: AOJu0Yy0XaNWRiXAT/gxKSkGegcZGuQ6YuoW/RhBBrFf6KhY0qg5lObZ Mp5qatWXpHwqV4FSDsoXuy9rR5mjr3nsIsw4G4frr0/fqtGDQe/yX6N0USEKMuY4Xb9vYsBpeQL aY2PfFwF7bLrog32P817nZf8i1ekFu5LpbXarzXfxnF2tDkmmQAmtLnuDtTiCgA== X-Received: by 2002:a17:906:495b:b0:a3e:97e6:dc1d with SMTP id f27-20020a170906495b00b00a3e97e6dc1dmr1492138ejt.52.1708342584341; Mon, 19 Feb 2024 03:36:24 -0800 (PST) X-Received: by 2002:a17:906:495b:b0:a3e:97e6:dc1d with SMTP id f27-20020a170906495b00b00a3e97e6dc1dmr1492124ejt.52.1708342584045; Mon, 19 Feb 2024 03:36:24 -0800 (PST) Received: from [10.40.98.142] ([78.108.130.194]) by smtp.gmail.com with ESMTPSA id ss1-20020a170907c00100b00a3e0c07c1a0sm2739493ejc.23.2024.02.19.03.36.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Feb 2024 03:36:23 -0800 (PST) Message-ID: Date: Mon, 19 Feb 2024 12:36:22 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] platform/x86: think-lmi: Fix password opcode ordering for workstations Content-Language: en-US To: Mark Pearson Cc: ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240209152359.528919-1-mpearson-lenovo@squebb.ca> From: Hans de Goede In-Reply-To: <20240209152359.528919-1-mpearson-lenovo@squebb.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On 2/9/24 16:23, Mark Pearson wrote: > The Lenovo workstations require the password opcode to be run before > the attribute value is changed (if Admin password is enabled). > > Tested on some Thinkpads to confirm they are OK with this order too. > > Signed-off-by: Mark Pearson Thank you for your patch, I've applied this patch to my review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans I've also added the Fixes tag and Ilpo's Reviewed-by. Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while. I will include this patch in my next fixes pull-req to Linus for the current kernel development cycle. Regards, Hans > --- > drivers/platform/x86/think-lmi.c | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c > index 3a396b763c49..ce3e08815a8e 100644 > --- a/drivers/platform/x86/think-lmi.c > +++ b/drivers/platform/x86/think-lmi.c > @@ -1009,7 +1009,16 @@ static ssize_t current_value_store(struct kobject *kobj, > * Note - this sets the variable and then the password as separate > * WMI calls. Function tlmi_save_bios_settings will error if the > * password is incorrect. > + * Workstation's require the opcode to be set before changing the > + * attribute. > */ > + if (tlmi_priv.pwd_admin->valid && tlmi_priv.pwd_admin->password[0]) { > + ret = tlmi_opcode_setting("WmiOpcodePasswordAdmin", > + tlmi_priv.pwd_admin->password); > + if (ret) > + goto out; > + } > + > set_str = kasprintf(GFP_KERNEL, "%s,%s;", setting->display_name, > new_setting); > if (!set_str) { > @@ -1021,17 +1030,10 @@ static ssize_t current_value_store(struct kobject *kobj, > if (ret) > goto out; > > - if (tlmi_priv.save_mode == TLMI_SAVE_BULK) { > + if (tlmi_priv.save_mode == TLMI_SAVE_BULK) > tlmi_priv.save_required = true; > - } else { > - if (tlmi_priv.pwd_admin->valid && tlmi_priv.pwd_admin->password[0]) { > - ret = tlmi_opcode_setting("WmiOpcodePasswordAdmin", > - tlmi_priv.pwd_admin->password); > - if (ret) > - goto out; > - } > + else > ret = tlmi_save_bios_settings(""); > - } > } else { /* old non-opcode based authentication method (deprecated) */ > if (tlmi_priv.pwd_admin->valid && tlmi_priv.pwd_admin->password[0]) { > auth_str = kasprintf(GFP_KERNEL, "%s,%s,%s;",