From: Mark Pearson Date: Thu, 24 Oct 2024 19:55:23 +0000 (-0400) Subject: platform/x86: think-lmi: Allow empty admin password X-Git-Tag: v6.13-rc1~147^2~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c0bbf1ae6502dfcd0df5d50013e55a71021c819;p=thirdparty%2Flinux.git platform/x86: think-lmi: Allow empty admin password SVP = BIOS Supervisor/Admin password SMP = BIOS System password If SMP ACL is enabled in the BIOS then the system allows you to set the SMP without a SVP password configured. Change code to allow this. BIOS will return permissions error if SVP is required. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20241024195536.6992-3-mpearson-lenovo@squebb.ca Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index 46ab82fb28989..c316b1b592d61 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -469,7 +469,12 @@ static ssize_t new_password_store(struct kobject *kobj, if (ret) goto out; - if (tlmi_priv.pwd_admin->pwd_enabled) { + /* + * Note admin password is not always required if SMPControl enabled in BIOS, + * So only set if it's configured. + * Let BIOS figure it out - we'll get an error if operation is not permitted + */ + if (tlmi_priv.pwd_admin->pwd_enabled && strlen(tlmi_priv.pwd_admin->password)) { ret = tlmi_opcode_setting("WmiOpcodePasswordAdmin", tlmi_priv.pwd_admin->password); if (ret)