Message ID | 20230419151321.6167-14-jorge.lopez2@hp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp466167vqo; Wed, 19 Apr 2023 08:16:44 -0700 (PDT) X-Google-Smtp-Source: AKy350ZDbqQByYjtsEfog7KEWdL+Ox1iD/2KLS1jfeFnladYvh5MCxlLuyjOG3WgDSrAlOA7635A X-Received: by 2002:a17:903:230f:b0:1a2:23f7:20f with SMTP id d15-20020a170903230f00b001a223f7020fmr6812333plh.28.1681917404017; Wed, 19 Apr 2023 08:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681917404; cv=none; d=google.com; s=arc-20160816; b=d9S0WdYbaViqZFzeZghxviOVjHzS0nXJyTKOKkauPGLIRqsUXklgvBKQtgxcH0Jc1q NGvUBRTLDfYRaxUIUVjXseLCV64NTzHbP0p6OKrJ4rcK8c15sWPzXCzuKXeAEaOTMZGb 3N/vWfExp+eHPL5GLi+cSbURm/S2Jz8rbmQNwbb/sfI4Q9ZE5PjSNgHX6n507UYhGKxq 261+3rUTURE90bYolqvTtiE+ehFaJnlv4AxFzhUvshpHp9z2fwIvNHIBvSLf/slqB4uD 0n7sS4U/p2D2iGieEf7l4Z7PHlnljwHkY/4sKlg/T0ABY8gVuc9eTvEDmwOZMWV0Pgor UjBQ== 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:to:from :dkim-signature; bh=ERiuGLSSLt14Zm3/7WEsnxh0ydwhBcPd1KCXT7ReQ90=; b=yq28QnE/vJoD2M56SDXktAfVL/zu5a+eKx/Ebi1yURkfnmOfPIQjj9Pu8/WIMz50cF yBzNNcp+e8zzcdFHsekykYftA/Pl9yv0aaaBkDzThvSMNUKhwwbGSs1kfkmKMtMVVYK9 AaHDBzYB9FDl5FsAYvwCEuBsR7/2XCVnF6H+WtMrgtZo/FsazySSWKi2rHnwqQMi+iH/ eGH8NhpVxLPsSYSXX4uBl4glZER0oJHMtzrhHu54vxkSn5FefQmZA9uQrACxU14uOTYt bQofeaEN8mdVtJr8DedvohiT5N2Ck6j0Fd/DkHbeaPdvmPfkdQkP5loY3churn13kB1Z skxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ira0HYJh; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jn7-20020a170903050700b001a1a0db7f5bsi15999837plb.335.2023.04.19.08.16.29; Wed, 19 Apr 2023 08:16:43 -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=20221208 header.b=ira0HYJh; 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 S233486AbjDSPO5 (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Wed, 19 Apr 2023 11:14:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233434AbjDSPNz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Apr 2023 11:13:55 -0400 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45C66FA; Wed, 19 Apr 2023 08:13:41 -0700 (PDT) Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6a5f7d10dd5so1481680a34.0; Wed, 19 Apr 2023 08:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681917220; x=1684509220; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ERiuGLSSLt14Zm3/7WEsnxh0ydwhBcPd1KCXT7ReQ90=; b=ira0HYJhcP5Y2+/1OMa2uJ3iYofcyda0Pcxvh5pY+1rb8HHarN4m9wLyLHOAWBiRqb C86ej8E1afVWP4f8yyqFZM6P23UVzuncgPJOk/GUi6N1TOsCV36ATpb5VfJE5D1EAvJ3 O6F4/vjY3frumyxx2twjF8w9kiYPoZaX9zV8tPc5I8Bls3KLNmHvZ4IEkEVvh5hZC5vn dFLI0GCaOn8RGatgcOe4RgoDZvMDbexmAWLh/GfdAE2E8EqPjCDAvchrpZhARAv/woz5 tkPXyPW1+iFV58hdAjN2olMWEGQpmbfJ+VkgbCtnoMEfn/uTa0FFyz6mAYSUIvuKPprM /xmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681917220; x=1684509220; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ERiuGLSSLt14Zm3/7WEsnxh0ydwhBcPd1KCXT7ReQ90=; b=Y5DJuiW5VEbfDSBFd7K0ffWLRfIKDZGTPUX/uIMDITHQiBF66Rl3mkcy9vyYAzTFTP aPj/s3Rt79SPWy5ifYkXaWoOM/1ddXsn+h8QiTrSYilXz+w74WwwYevVrHHNXeMsQY/U yHzXNUfKW/7dgnkLMrDaQf1p+pBg+vKyYPVcBUNnM+1OzaNTrPuhBxhTePLFixmivaV8 layh6qwn4dmthNrr6TpAFIYcuCfHu2zovGpbot72t60q2VhJ6AG3xpYPL2MfecEuhZhA Ej7J4fDA09KLHMoAsbZJVHeKaMufQimT5eUnMcY/BA8TGu+rCQawUhoj0xrJP4GKU/FZ gmkA== X-Gm-Message-State: AAQBX9enN47IXEKz2aMO61AapcWRMWwp4wlVqDfhp4xz1nnBKFA7miCr Xe9WBZs+kcnLdsnVDmA14MU= X-Received: by 2002:a05:6830:1206:b0:6a5:d98d:e943 with SMTP id r6-20020a056830120600b006a5d98de943mr2914726otp.29.1681917220568; Wed, 19 Apr 2023 08:13:40 -0700 (PDT) Received: from grumpy-VECTOR.hsd1.tx.comcast.net ([2601:2c3:480:7390:e175:6963:338:7453]) by smtp.gmail.com with ESMTPSA id f17-20020a056830205100b00690e990e61asm4308842otp.14.2023.04.19.08.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 08:13:40 -0700 (PDT) From: Jorge Lopez <jorgealtxwork@gmail.com> X-Google-Original-From: Jorge Lopez <jorge.lopez2@hp.com> To: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, thomas@t-8ch.de Subject: [PATCH v10 13/14] HP BIOSCFG driver - Makefile Date: Wed, 19 Apr 2023 10:13:20 -0500 Message-Id: <20230419151321.6167-14-jorge.lopez2@hp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419151321.6167-1-jorge.lopez2@hp.com> References: <20230419151321.6167-1-jorge.lopez2@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1763618223499365226?= X-GMAIL-MSGID: =?utf-8?q?1763618223499365226?= |
Series |
HP BIOSCFG driver
|
|
Commit Message
Jorge Lopez
April 19, 2023, 3:13 p.m. UTC
HP BIOS Configuration driver purpose is to provide a driver supporting
the latest sysfs class firmware attributes framework allowing the user
to change BIOS settings and security solutions on HP Inc.’s commercial
notebooks.
Many features of HP Commercial notebooks can be managed using Windows
Management Instrumentation (WMI). WMI is an implementation of Web-Based
Enterprise Management (WBEM) that provides a standards-based interface
for changing and monitoring system settings. HP BIOSCFG driver provides
a native Linux solution and the exposed features facilitates the
migration to Linux environments.
The Linux security features to be provided in hp-bioscfg driver enables
managing the BIOS settings and security solutions via sysfs, a virtual
filesystem that can be used by user-mode applications. The new
documentation cover HP-specific firmware sysfs attributes such Secure
Platform Management and Sure Start. Each section provides security
feature description and identifies sysfs directories and files exposed
by the driver.
Many HP Commercial notebooks include a feature called Secure Platform
Management (SPM), which replaces older password-based BIOS settings
management with public key cryptography. PC secure product management
begins when a target system is provisioned with cryptographic keys
that are used to ensure the integrity of communications between system
management utilities and the BIOS.
HP Commercial notebooks have several BIOS settings that control its
behaviour and capabilities, many of which are related to security.
To prevent unauthorized changes to these settings, the system can
be configured to use a cryptographic signature-based authorization
string that the BIOS will use to verify authorization to modify the
setting.
Linux Security components are under development and not published yet.
The only linux component is the driver (hp bioscfg) at this time.
Other published security components are under Windows.
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
---
Based on the latest platform-drivers-x86.git/for-next
---
drivers/platform/x86/hp/Kconfig | 16 ++++++++++++++++
drivers/platform/x86/hp/Makefile | 1 +
drivers/platform/x86/hp/hp-bioscfg/Makefile | 13 +++++++++++++
3 files changed, 30 insertions(+)
create mode 100644 drivers/platform/x86/hp/hp-bioscfg/Makefile
Comments
Hi Jorge, kernel test robot noticed the following build warnings: [auto build test WARNING on linus/master] [also build test WARNING on v6.3-rc7 next-20230419] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Jorge-Lopez/HP-BIOSCFG-driver-Documentation/20230419-231828 patch link: https://lore.kernel.org/r/20230419151321.6167-14-jorge.lopez2%40hp.com patch subject: [PATCH v10 13/14] HP BIOSCFG driver - Makefile config: i386-randconfig-a015-20230417 (https://download.01.org/0day-ci/archive/20230420/202304200914.VfJcRutc-lkp@intel.com/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/cfbebfbd4ed15793fab894715bfd74387adcf4f1 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Jorge-Lopez/HP-BIOSCFG-driver-Documentation/20230419-231828 git checkout cfbebfbd4ed15793fab894715bfd74387adcf4f1 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/platform/x86/hp/hp-bioscfg/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202304200914.VfJcRutc-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c:141:2: warning: variable 'id' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!buf_cp) { ^~~~~~~~~~~~ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c:169:18: note: uninitialized use occurs here clear_passwords(id); ^~ drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c:141:2: note: remove the 'if' if its condition is always false if (!buf_cp) { ^~~~~~~~~~~~~~ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c:138:8: note: initialize the variable 'id' to silence this warning int id, ret = -EIO; ^ = 0 1 warning generated. -- >> drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:76:2: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!start) ^~~~~~~~~~~ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:87:9: note: uninitialized use occurs here return ret; ^~~ drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:76:2: note: remove the 'if' if its condition is always false if (!start) ^~~~~~~~~~~ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:72:2: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!start) ^~~~~~~~~~~ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:87:9: note: uninitialized use occurs here return ret; ^~~ drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:72:2: note: remove the 'if' if its condition is always false if (!start) ^~~~~~~~~~~ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:43:2: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (instance < 0) ^~~~~~~~~~~~~~~~~ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:87:9: note: uninitialized use occurs here return ret; ^~~ drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:43:2: note: remove the 'if' if its condition is always false if (instance < 0) ^~~~~~~~~~~~~~~~~ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:30:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 3 warnings generated. vim +141 drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c 1780f5eca27fb8 Jorge Lopez 2023-04-19 132 1780f5eca27fb8 Jorge Lopez 2023-04-19 133 static ssize_t new_password_store(struct kobject *kobj, 1780f5eca27fb8 Jorge Lopez 2023-04-19 134 struct kobj_attribute *attr, 1780f5eca27fb8 Jorge Lopez 2023-04-19 135 const char *buf, size_t count) 1780f5eca27fb8 Jorge Lopez 2023-04-19 136 { 1780f5eca27fb8 Jorge Lopez 2023-04-19 137 char *p, *buf_cp = NULL; 1780f5eca27fb8 Jorge Lopez 2023-04-19 138 int id, ret = -EIO; 1780f5eca27fb8 Jorge Lopez 2023-04-19 139 1780f5eca27fb8 Jorge Lopez 2023-04-19 140 buf_cp = kstrdup(buf, GFP_KERNEL); 1780f5eca27fb8 Jorge Lopez 2023-04-19 @141 if (!buf_cp) { 1780f5eca27fb8 Jorge Lopez 2023-04-19 142 ret = -ENOMEM; 1780f5eca27fb8 Jorge Lopez 2023-04-19 143 goto exit_password; 1780f5eca27fb8 Jorge Lopez 2023-04-19 144 } 1780f5eca27fb8 Jorge Lopez 2023-04-19 145 1780f5eca27fb8 Jorge Lopez 2023-04-19 146 p = memchr(buf_cp, '\n', count); 1780f5eca27fb8 Jorge Lopez 2023-04-19 147 1780f5eca27fb8 Jorge Lopez 2023-04-19 148 if (p != NULL) 1780f5eca27fb8 Jorge Lopez 2023-04-19 149 *p = '\0'; 1780f5eca27fb8 Jorge Lopez 2023-04-19 150 1780f5eca27fb8 Jorge Lopez 2023-04-19 151 id = get_password_instance_id(kobj); 1780f5eca27fb8 Jorge Lopez 2023-04-19 152 1780f5eca27fb8 Jorge Lopez 2023-04-19 153 if (id >= 0) 1780f5eca27fb8 Jorge Lopez 2023-04-19 154 ret = validate_password_input(id, buf_cp); 1780f5eca27fb8 Jorge Lopez 2023-04-19 155 1780f5eca27fb8 Jorge Lopez 2023-04-19 156 if (!ret) 1780f5eca27fb8 Jorge Lopez 2023-04-19 157 strscpy(bioscfg_drv.password_data[id].new_password, 1780f5eca27fb8 Jorge Lopez 2023-04-19 158 buf_cp, 1780f5eca27fb8 Jorge Lopez 2023-04-19 159 sizeof(bioscfg_drv.password_data[id].new_password)); 1780f5eca27fb8 Jorge Lopez 2023-04-19 160 1780f5eca27fb8 Jorge Lopez 2023-04-19 161 if (!ret) 1780f5eca27fb8 Jorge Lopez 2023-04-19 162 ret = hp_set_attribute(kobj->name, buf_cp); 1780f5eca27fb8 Jorge Lopez 2023-04-19 163 1780f5eca27fb8 Jorge Lopez 2023-04-19 164 exit_password: 1780f5eca27fb8 Jorge Lopez 2023-04-19 165 /* 1780f5eca27fb8 Jorge Lopez 2023-04-19 166 * Regardless of the results both new and current passwords 1780f5eca27fb8 Jorge Lopez 2023-04-19 167 * will be set to zero and avoid security issues 1780f5eca27fb8 Jorge Lopez 2023-04-19 168 */ 1780f5eca27fb8 Jorge Lopez 2023-04-19 169 clear_passwords(id); 1780f5eca27fb8 Jorge Lopez 2023-04-19 170 1780f5eca27fb8 Jorge Lopez 2023-04-19 171 kfree(buf_cp); 1780f5eca27fb8 Jorge Lopez 2023-04-19 172 return ret ? ret : count; 1780f5eca27fb8 Jorge Lopez 2023-04-19 173 } 1780f5eca27fb8 Jorge Lopez 2023-04-19 174
Hi Jorge, kernel test robot noticed the following build warnings: [auto build test WARNING on linus/master] [also build test WARNING on v6.3-rc7 next-20230419] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Jorge-Lopez/HP-BIOSCFG-driver-Documentation/20230419-231828 patch link: https://lore.kernel.org/r/20230419151321.6167-14-jorge.lopez2%40hp.com patch subject: [PATCH v10 13/14] HP BIOSCFG driver - Makefile config: i386-randconfig-s002-20230417 (https://download.01.org/0day-ci/archive/20230420/202304201100.r6QLG0Fc-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://github.com/intel-lab-lkp/linux/commit/cfbebfbd4ed15793fab894715bfd74387adcf4f1 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Jorge-Lopez/HP-BIOSCFG-driver-Documentation/20230419-231828 git checkout cfbebfbd4ed15793fab894715bfd74387adcf4f1 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 olddefconfig make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/platform/x86/hp/hp-bioscfg/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202304201100.r6QLG0Fc-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/platform/x86/hp/hp-bioscfg/surestart-attributes.c:80:23: sparse: sparse: symbol 'sure_start_audit_log_entries' was not declared. Should it be static? -- >> drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:191:23: sparse: sparse: symbol 'password_spm_status' was not declared. Should it be static?
Thank you for the heads up. I will look them over. Regards, Jorge On Wed, Apr 19, 2023 at 10:57 PM kernel test robot <lkp@intel.com> wrote: > > Hi Jorge, > > kernel test robot noticed the following build warnings: > > [auto build test WARNING on linus/master] > [also build test WARNING on v6.3-rc7 next-20230419] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Jorge-Lopez/HP-BIOSCFG-driver-Documentation/20230419-231828 > patch link: https://lore.kernel.org/r/20230419151321.6167-14-jorge.lopez2%40hp.com > patch subject: [PATCH v10 13/14] HP BIOSCFG driver - Makefile > config: i386-randconfig-s002-20230417 (https://download.01.org/0day-ci/archive/20230420/202304201100.r6QLG0Fc-lkp@intel.com/config) > compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 > reproduce: > # apt-get install sparse > # sparse version: v0.6.4-39-gce1a6720-dirty > # https://github.com/intel-lab-lkp/linux/commit/cfbebfbd4ed15793fab894715bfd74387adcf4f1 > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Jorge-Lopez/HP-BIOSCFG-driver-Documentation/20230419-231828 > git checkout cfbebfbd4ed15793fab894715bfd74387adcf4f1 > # save the config file > mkdir build_dir && cp config build_dir/.config > make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 olddefconfig > make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/platform/x86/hp/hp-bioscfg/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > | Link: https://lore.kernel.org/oe-kbuild-all/202304201100.r6QLG0Fc-lkp@intel.com/ > > sparse warnings: (new ones prefixed by >>) > >> drivers/platform/x86/hp/hp-bioscfg/surestart-attributes.c:80:23: sparse: sparse: symbol 'sure_start_audit_log_entries' was not declared. Should it be static? > -- > >> drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:191:23: sparse: sparse: symbol 'password_spm_status' was not declared. Should it be static? > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests
Thank you. I will address those issues. Regards, Jorge On Wed, Apr 19, 2023 at 8:45 PM kernel test robot <lkp@intel.com> wrote: > > Hi Jorge, > > kernel test robot noticed the following build warnings: > > [auto build test WARNING on linus/master] > [also build test WARNING on v6.3-rc7 next-20230419] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Jorge-Lopez/HP-BIOSCFG-driver-Documentation/20230419-231828 > patch link: https://lore.kernel.org/r/20230419151321.6167-14-jorge.lopez2%40hp.com > patch subject: [PATCH v10 13/14] HP BIOSCFG driver - Makefile > config: i386-randconfig-a015-20230417 (https://download.01.org/0day-ci/archive/20230420/202304200914.VfJcRutc-lkp@intel.com/config) > compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/intel-lab-lkp/linux/commit/cfbebfbd4ed15793fab894715bfd74387adcf4f1 > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Jorge-Lopez/HP-BIOSCFG-driver-Documentation/20230419-231828 > git checkout cfbebfbd4ed15793fab894715bfd74387adcf4f1 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/platform/x86/hp/hp-bioscfg/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > | Link: https://lore.kernel.org/oe-kbuild-all/202304200914.VfJcRutc-lkp@intel.com/ > > All warnings (new ones prefixed by >>): > > >> drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c:141:2: warning: variable 'id' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > if (!buf_cp) { > ^~~~~~~~~~~~ > include/linux/compiler.h:56:28: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var' > #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c:169:18: note: uninitialized use occurs here > clear_passwords(id); > ^~ > drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c:141:2: note: remove the 'if' if its condition is always false > if (!buf_cp) { > ^~~~~~~~~~~~~~ > include/linux/compiler.h:56:23: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ^ > drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c:138:8: note: initialize the variable 'id' to silence this warning > int id, ret = -EIO; > ^ > = 0 > 1 warning generated. > -- > >> drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:76:2: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > if (!start) > ^~~~~~~~~~~ > include/linux/compiler.h:56:28: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var' > #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:87:9: note: uninitialized use occurs here > return ret; > ^~~ > drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:76:2: note: remove the 'if' if its condition is always false > if (!start) > ^~~~~~~~~~~ > include/linux/compiler.h:56:23: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ^ > drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:72:2: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > if (!start) > ^~~~~~~~~~~ > include/linux/compiler.h:56:28: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var' > #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:87:9: note: uninitialized use occurs here > return ret; > ^~~ > drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:72:2: note: remove the 'if' if its condition is always false > if (!start) > ^~~~~~~~~~~ > include/linux/compiler.h:56:23: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ^ > drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:43:2: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > if (instance < 0) > ^~~~~~~~~~~~~~~~~ > include/linux/compiler.h:56:28: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var' > #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:87:9: note: uninitialized use occurs here > return ret; > ^~~ > drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:43:2: note: remove the 'if' if its condition is always false > if (instance < 0) > ^~~~~~~~~~~~~~~~~ > include/linux/compiler.h:56:23: note: expanded from macro 'if' > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > ^ > drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c:30:9: note: initialize the variable 'ret' to silence this warning > int ret; > ^ > = 0 > 3 warnings generated. > > > vim +141 drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c > > 1780f5eca27fb8 Jorge Lopez 2023-04-19 132 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 133 static ssize_t new_password_store(struct kobject *kobj, > 1780f5eca27fb8 Jorge Lopez 2023-04-19 134 struct kobj_attribute *attr, > 1780f5eca27fb8 Jorge Lopez 2023-04-19 135 const char *buf, size_t count) > 1780f5eca27fb8 Jorge Lopez 2023-04-19 136 { > 1780f5eca27fb8 Jorge Lopez 2023-04-19 137 char *p, *buf_cp = NULL; > 1780f5eca27fb8 Jorge Lopez 2023-04-19 138 int id, ret = -EIO; > 1780f5eca27fb8 Jorge Lopez 2023-04-19 139 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 140 buf_cp = kstrdup(buf, GFP_KERNEL); > 1780f5eca27fb8 Jorge Lopez 2023-04-19 @141 if (!buf_cp) { > 1780f5eca27fb8 Jorge Lopez 2023-04-19 142 ret = -ENOMEM; > 1780f5eca27fb8 Jorge Lopez 2023-04-19 143 goto exit_password; > 1780f5eca27fb8 Jorge Lopez 2023-04-19 144 } > 1780f5eca27fb8 Jorge Lopez 2023-04-19 145 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 146 p = memchr(buf_cp, '\n', count); > 1780f5eca27fb8 Jorge Lopez 2023-04-19 147 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 148 if (p != NULL) > 1780f5eca27fb8 Jorge Lopez 2023-04-19 149 *p = '\0'; > 1780f5eca27fb8 Jorge Lopez 2023-04-19 150 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 151 id = get_password_instance_id(kobj); > 1780f5eca27fb8 Jorge Lopez 2023-04-19 152 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 153 if (id >= 0) > 1780f5eca27fb8 Jorge Lopez 2023-04-19 154 ret = validate_password_input(id, buf_cp); > 1780f5eca27fb8 Jorge Lopez 2023-04-19 155 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 156 if (!ret) > 1780f5eca27fb8 Jorge Lopez 2023-04-19 157 strscpy(bioscfg_drv.password_data[id].new_password, > 1780f5eca27fb8 Jorge Lopez 2023-04-19 158 buf_cp, > 1780f5eca27fb8 Jorge Lopez 2023-04-19 159 sizeof(bioscfg_drv.password_data[id].new_password)); > 1780f5eca27fb8 Jorge Lopez 2023-04-19 160 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 161 if (!ret) > 1780f5eca27fb8 Jorge Lopez 2023-04-19 162 ret = hp_set_attribute(kobj->name, buf_cp); > 1780f5eca27fb8 Jorge Lopez 2023-04-19 163 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 164 exit_password: > 1780f5eca27fb8 Jorge Lopez 2023-04-19 165 /* > 1780f5eca27fb8 Jorge Lopez 2023-04-19 166 * Regardless of the results both new and current passwords > 1780f5eca27fb8 Jorge Lopez 2023-04-19 167 * will be set to zero and avoid security issues > 1780f5eca27fb8 Jorge Lopez 2023-04-19 168 */ > 1780f5eca27fb8 Jorge Lopez 2023-04-19 169 clear_passwords(id); > 1780f5eca27fb8 Jorge Lopez 2023-04-19 170 > 1780f5eca27fb8 Jorge Lopez 2023-04-19 171 kfree(buf_cp); > 1780f5eca27fb8 Jorge Lopez 2023-04-19 172 return ret ? ret : count; > 1780f5eca27fb8 Jorge Lopez 2023-04-19 173 } > 1780f5eca27fb8 Jorge Lopez 2023-04-19 174 > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests
diff --git a/drivers/platform/x86/hp/Kconfig b/drivers/platform/x86/hp/Kconfig index ae165955311c..7fef4f12e498 100644 --- a/drivers/platform/x86/hp/Kconfig +++ b/drivers/platform/x86/hp/Kconfig @@ -60,4 +60,20 @@ config TC1100_WMI This is a driver for the WMI extensions (wireless and bluetooth power control) of the HP Compaq TC1100 tablet. +config HP_BIOSCFG + tristate "HP BIOS Configuration Driver" + default m + depends on ACPI_WMI + select NLS + select FW_ATTR_CLASS + help + This driver enables administrators to securely manage BIOS settings + using digital certificates and public-key cryptography that eliminate + the need for passwords for both remote and local management. It supports + changing BIOS settings on many HP machines from 2018 and newer without + the use of any additional software. + + To compile this driver as a module, choose M here: the module will + be called hp-bioscfg. + endif # X86_PLATFORM_DRIVERS_HP diff --git a/drivers/platform/x86/hp/Makefile b/drivers/platform/x86/hp/Makefile index db1eed4cd7c7..e4f908a61acf 100644 --- a/drivers/platform/x86/hp/Makefile +++ b/drivers/platform/x86/hp/Makefile @@ -8,3 +8,4 @@ obj-$(CONFIG_HP_ACCEL) += hp_accel.o obj-$(CONFIG_HP_WMI) += hp-wmi.o obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o +obj-$(CONFIG_HP_BIOSCFG) += hp-bioscfg/ diff --git a/drivers/platform/x86/hp/hp-bioscfg/Makefile b/drivers/platform/x86/hp/hp-bioscfg/Makefile new file mode 100644 index 000000000000..529eba6fa47f --- /dev/null +++ b/drivers/platform/x86/hp/hp-bioscfg/Makefile @@ -0,0 +1,13 @@ +obj-$(CONFIG_HP_BIOSCFG) := hp-bioscfg.o + +hp-bioscfg-objs := bioscfg.o \ + enum-attributes.o \ + int-attributes.o \ + string-attributes.o \ + passwdobj-attributes.o \ + biosattr-interface.o \ + passwdattr-interface.o \ + ordered-attributes.o \ + surestart-attributes.o \ + spmobj-attributes.o +