All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: Re: [PATCH 09/13] platform/x86: lenovo: tlmi: Add authentication sysfs entries
Date: Sat, 5 Dec 2026 17:55:18 +0800	[thread overview]
Message-ID: <20261205035448.5vnIqP7d-lkp@intel.com> (raw)

:::::: 
:::::: Manual check reason: "same reports for this branch"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20261204022032.3074618-10-mpearson-lenovo@squebb.ca>
References: <20261204022032.3074618-10-mpearson-lenovo@squebb.ca>
TO: Mark Pearson <mpearson-lenovo@squebb.ca>
TO: mpearson-lenovo@squebb.ca
CC: derekjohn.clark@gmail.com
CC: i@rong.moe
CC: hansg@kernel.org
CC: ilpo.jarvinen@linux.intel.com
CC: platform-driver-x86@vger.kernel.org
CC: linux-kernel@vger.kernel.org

Hi Mark,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v7.4-rc5 next-20261203]
[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/Mark-Pearson/platform-x86-lenovo-think-lmi-Convert-name-arrays-to-pointers/20261203-212010
base:   linus/master
patch link:    https://lore.kernel.org/r/20261204022032.3074618-10-mpearson-lenovo%40squebb.ca
patch subject: [PATCH 09/13] platform/x86: lenovo: tlmi: Add authentication sysfs entries
:::::: branch date: 16 hours ago
:::::: commit date: 16 hours ago
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20261205/20261205035448.5vnIqP7d-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261205/20261205035448.5vnIqP7d-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261205035448.5vnIqP7d-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/platform/x86/lenovo/tlmi-auth.c: In function 'new_password_store':
>> drivers/platform/x86/lenovo/tlmi-auth.c:144:14: error: implicit declaration of function 'capable' [-Wimplicit-function-declaration]
     144 |         if (!capable(CAP_SYS_ADMIN))
         |              ^~~~~~~
>> drivers/platform/x86/lenovo/tlmi-auth.c:144:22: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
     144 |         if (!capable(CAP_SYS_ADMIN))
         |                      ^~~~~~~~~~~~~
   drivers/platform/x86/lenovo/tlmi-auth.c:144:22: note: each undeclared identifier is reported only once for each function it appears in
   drivers/platform/x86/lenovo/tlmi-auth.c: In function 'cert_to_password_store':
   drivers/platform/x86/lenovo/tlmi-auth.c:409:22: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
     409 |         if (!capable(CAP_SYS_ADMIN))
         |                      ^~~~~~~~~~~~~
   drivers/platform/x86/lenovo/tlmi-auth.c: In function 'certificate_store':
   drivers/platform/x86/lenovo/tlmi-auth.c:476:22: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
     476 |         if (!capable(CAP_SYS_ADMIN))
         |                      ^~~~~~~~~~~~~
   drivers/platform/x86/lenovo/tlmi-auth.c: In function 'signature_store':
   drivers/platform/x86/lenovo/tlmi-auth.c:585:22: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
     585 |         if (!capable(CAP_SYS_ADMIN))
         |                      ^~~~~~~~~~~~~
   drivers/platform/x86/lenovo/tlmi-auth.c: In function 'save_signature_store':
   drivers/platform/x86/lenovo/tlmi-auth.c:612:22: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
     612 |         if (!capable(CAP_SYS_ADMIN))
         |                      ^~~~~~~~~~~~~


vim +/capable +144 drivers/platform/x86/lenovo/tlmi-auth.c

380a386e1f8ad51 Mark Pearson 2026-12-03  130  
380a386e1f8ad51 Mark Pearson 2026-12-03  131  static ssize_t new_password_store(struct kobject *kobj,
380a386e1f8ad51 Mark Pearson 2026-12-03  132  				  struct kobj_attribute *attr,
380a386e1f8ad51 Mark Pearson 2026-12-03  133  				  const char *buf, size_t count)
380a386e1f8ad51 Mark Pearson 2026-12-03  134  {
380a386e1f8ad51 Mark Pearson 2026-12-03  135  	struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj);
380a386e1f8ad51 Mark Pearson 2026-12-03  136  	struct think_lmi *td = dev_get_drvdata(&setting->wdev->dev);
380a386e1f8ad51 Mark Pearson 2026-12-03  137  	enum pwd_type_v2 pwd_type;
380a386e1f8ad51 Mark Pearson 2026-12-03  138  	size_t pwdlen, cur_pwdlen;
380a386e1f8ad51 Mark Pearson 2026-12-03  139  	struct wmi_buffer wmibuf;
380a386e1f8ad51 Mark Pearson 2026-12-03  140  	char *start;
380a386e1f8ad51 Mark Pearson 2026-12-03  141  	int ix = 0;
380a386e1f8ad51 Mark Pearson 2026-12-03  142  	int ret;
380a386e1f8ad51 Mark Pearson 2026-12-03  143  
380a386e1f8ad51 Mark Pearson 2026-12-03 @144  	if (!capable(CAP_SYS_ADMIN))
380a386e1f8ad51 Mark Pearson 2026-12-03  145  		return -EPERM;
380a386e1f8ad51 Mark Pearson 2026-12-03  146  
380a386e1f8ad51 Mark Pearson 2026-12-03  147  	guard(mutex)(&td->tlmi_auth_lock);
380a386e1f8ad51 Mark Pearson 2026-12-03  148  
380a386e1f8ad51 Mark Pearson 2026-12-03  149  	/* Authorisation needs to be done first */
380a386e1f8ad51 Mark Pearson 2026-12-03  150  	ret = tlmi_auth_authenticate_user(td);
380a386e1f8ad51 Mark Pearson 2026-12-03  151  	/* Ignore most errors. We might be in deployment mode */
380a386e1f8ad51 Mark Pearson 2026-12-03  152  	if (ret == -ENOMEM)
380a386e1f8ad51 Mark Pearson 2026-12-03  153  		return ret;
380a386e1f8ad51 Mark Pearson 2026-12-03  154  
380a386e1f8ad51 Mark Pearson 2026-12-03  155  	/* Strip out CR if one is present, setting password won't work if it is present */
380a386e1f8ad51 Mark Pearson 2026-12-03  156  	char *new_pwd __free(kfree_sensitive) = kstrdup_and_replace(buf, '\n', '\0', GFP_KERNEL);
380a386e1f8ad51 Mark Pearson 2026-12-03  157  	if (!new_pwd)
380a386e1f8ad51 Mark Pearson 2026-12-03  158  		return -ENOMEM;
380a386e1f8ad51 Mark Pearson 2026-12-03  159  
380a386e1f8ad51 Mark Pearson 2026-12-03  160  	pwdlen = strlen(new_pwd);
380a386e1f8ad51 Mark Pearson 2026-12-03  161  	/* pwdlen == 0 is allowed to clear the password */
380a386e1f8ad51 Mark Pearson 2026-12-03  162  	if (pwdlen && (pwdlen < setting->minlen || pwdlen > setting->maxlen))
380a386e1f8ad51 Mark Pearson 2026-12-03  163  		return -EINVAL;
380a386e1f8ad51 Mark Pearson 2026-12-03  164  
380a386e1f8ad51 Mark Pearson 2026-12-03  165  	cur_pwdlen = struct_size_t(struct wmi_string, chars, strlen(setting->password) + 1);
380a386e1f8ad51 Mark Pearson 2026-12-03  166  	pwdlen = struct_size_t(struct wmi_string, chars, strlen(new_pwd) + 1);
380a386e1f8ad51 Mark Pearson 2026-12-03  167  	wmibuf.length = 2 + cur_pwdlen + pwdlen;
380a386e1f8ad51 Mark Pearson 2026-12-03  168  	char *wmidata __free(kfree_sensitive) = kzalloc(wmibuf.length, GFP_KERNEL);
380a386e1f8ad51 Mark Pearson 2026-12-03  169  	if (!wmidata)
380a386e1f8ad51 Mark Pearson 2026-12-03  170  		return -ENOMEM;
380a386e1f8ad51 Mark Pearson 2026-12-03  171  	wmibuf.data = wmidata;
380a386e1f8ad51 Mark Pearson 2026-12-03  172  
380a386e1f8ad51 Mark Pearson 2026-12-03  173  	if (setting == td->pwd_admin) {
380a386e1f8ad51 Mark Pearson 2026-12-03  174  		pwd_type = SVP;
380a386e1f8ad51 Mark Pearson 2026-12-03  175  	} else if (setting == td->pwd_power) {
380a386e1f8ad51 Mark Pearson 2026-12-03  176  		pwd_type = POP;
380a386e1f8ad51 Mark Pearson 2026-12-03  177  	} else if (setting == td->pwd_system) {
380a386e1f8ad51 Mark Pearson 2026-12-03  178  		pwd_type = SMP;
380a386e1f8ad51 Mark Pearson 2026-12-03  179  	} else if (setting == td->pwd_hdd) {
380a386e1f8ad51 Mark Pearson 2026-12-03  180  		if (setting->level == TLMI_LEVEL_MASTER)
380a386e1f8ad51 Mark Pearson 2026-12-03  181  			pwd_type = MASTERHDD;
380a386e1f8ad51 Mark Pearson 2026-12-03  182  		else
380a386e1f8ad51 Mark Pearson 2026-12-03  183  			pwd_type = HDD;
380a386e1f8ad51 Mark Pearson 2026-12-03  184  		pwd_type += setting->index - 1;
380a386e1f8ad51 Mark Pearson 2026-12-03  185  	} else if (setting == td->pwd_nvme) {
380a386e1f8ad51 Mark Pearson 2026-12-03  186  		if (setting->level == TLMI_LEVEL_MASTER)
380a386e1f8ad51 Mark Pearson 2026-12-03  187  			pwd_type = MASTERNVME;
380a386e1f8ad51 Mark Pearson 2026-12-03  188  		else
380a386e1f8ad51 Mark Pearson 2026-12-03  189  			pwd_type = NVME;
380a386e1f8ad51 Mark Pearson 2026-12-03  190  		pwd_type += setting->index - 1;
380a386e1f8ad51 Mark Pearson 2026-12-03  191  	} else {
380a386e1f8ad51 Mark Pearson 2026-12-03  192  		return -EOPNOTSUPP;
380a386e1f8ad51 Mark Pearson 2026-12-03  193  	}
380a386e1f8ad51 Mark Pearson 2026-12-03  194  
380a386e1f8ad51 Mark Pearson 2026-12-03  195  	start = wmibuf.data;
380a386e1f8ad51 Mark Pearson 2026-12-03  196  	start[0] = pwd_type;
380a386e1f8ad51 Mark Pearson 2026-12-03  197  	start += 2;
380a386e1f8ad51 Mark Pearson 2026-12-03  198  
380a386e1f8ad51 Mark Pearson 2026-12-03  199  	ix = tlmi_populate_string_buffer(start, cur_pwdlen, setting->password);
380a386e1f8ad51 Mark Pearson 2026-12-03  200  	if (ix < 0)
380a386e1f8ad51 Mark Pearson 2026-12-03  201  		return ix;
380a386e1f8ad51 Mark Pearson 2026-12-03  202  	start += ix;
380a386e1f8ad51 Mark Pearson 2026-12-03  203  	ix = tlmi_populate_string_buffer(start, pwdlen, new_pwd);
380a386e1f8ad51 Mark Pearson 2026-12-03  204  	if (ix < 0)
380a386e1f8ad51 Mark Pearson 2026-12-03  205  		return ix;
380a386e1f8ad51 Mark Pearson 2026-12-03  206  
380a386e1f8ad51 Mark Pearson 2026-12-03  207  	ret = tlmi_request(td->auth_wdev, 0, SET_PASSWORD, &wmibuf);
380a386e1f8ad51 Mark Pearson 2026-12-03  208  	return ret ?: count;
380a386e1f8ad51 Mark Pearson 2026-12-03  209  }
380a386e1f8ad51 Mark Pearson 2026-12-03  210  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2026-12-05  9:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  9:55 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-12-04  2:20 [PATCH 00/13] New Lenovo common WMI driver - tlmi Mark Pearson
2026-12-04  2:20 ` [PATCH 09/13] platform/x86: lenovo: tlmi: Add authentication sysfs entries Mark Pearson
2026-12-04 13:52   ` Rong Zhang
2026-12-05  9:55   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205035448.5vnIqP7d-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.