* fs/efivarfs/vars.c:375: warning: Function parameter or struct member 'duplicate_check' not described in 'efivar_init'
@ 2025-01-09 21:02 kernel test robot
2025-01-09 21:52 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2025-01-09 21:02 UTC (permalink / raw)
To: James Bottomley; +Cc: oe-kbuild-all, linux-efi, Ard Biesheuvel
tree: https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head: 5e948d5cefebebe2315faf356d7b5180144b17b0
commit: 43039cdd1a14ed12c7b506a2d78c7fa708444b06 efivarfs: add variable resync after hibernation
date: 11 hours ago
config: x86_64-buildonly-randconfig-002-20250109 (https://download.01.org/0day-ci/archive/20250110/202501100429.RSwlJMm0-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250110/202501100429.RSwlJMm0-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/oe-kbuild-all/202501100429.RSwlJMm0-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/efivarfs/vars.c:375: warning: Function parameter or struct member 'duplicate_check' not described in 'efivar_init'
vim +375 fs/efivarfs/vars.c
2d82e6227ea189 Ard Biesheuvel 2022-06-20 362
2d82e6227ea189 Ard Biesheuvel 2022-06-20 363 /**
2d82e6227ea189 Ard Biesheuvel 2022-06-20 364 * efivar_init - build the initial list of EFI variables
2d82e6227ea189 Ard Biesheuvel 2022-06-20 365 * @func: callback function to invoke for every variable
2d82e6227ea189 Ard Biesheuvel 2022-06-20 366 * @data: function-specific data to pass to @func
2d82e6227ea189 Ard Biesheuvel 2022-06-20 367 *
2d82e6227ea189 Ard Biesheuvel 2022-06-20 368 * Get every EFI variable from the firmware and invoke @func. @func
b538f1e229e58c James Bottomley 2025-01-06 369 * should populate the initial dentry and inode tree.
2d82e6227ea189 Ard Biesheuvel 2022-06-20 370 *
2d82e6227ea189 Ard Biesheuvel 2022-06-20 371 * Returns 0 on success, or a kernel error code on failure.
2d82e6227ea189 Ard Biesheuvel 2022-06-20 372 */
b538f1e229e58c James Bottomley 2025-01-06 373 int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *),
43039cdd1a14ed James Bottomley 2025-01-07 374 void *data, bool duplicate_check)
2d82e6227ea189 Ard Biesheuvel 2022-06-20 @375 {
f45812cc23fb74 Tim Schumacher 2024-01-26 376 unsigned long variable_name_size = 512;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 377 efi_char16_t *variable_name;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 378 efi_status_t status;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 379 efi_guid_t vendor_guid;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 380 int err = 0;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 381
2d82e6227ea189 Ard Biesheuvel 2022-06-20 382 variable_name = kzalloc(variable_name_size, GFP_KERNEL);
2d82e6227ea189 Ard Biesheuvel 2022-06-20 383 if (!variable_name) {
2d82e6227ea189 Ard Biesheuvel 2022-06-20 384 printk(KERN_ERR "efivars: Memory allocation failed.\n");
2d82e6227ea189 Ard Biesheuvel 2022-06-20 385 return -ENOMEM;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 386 }
2d82e6227ea189 Ard Biesheuvel 2022-06-20 387
2d82e6227ea189 Ard Biesheuvel 2022-06-20 388 err = efivar_lock();
2d82e6227ea189 Ard Biesheuvel 2022-06-20 389 if (err)
2d82e6227ea189 Ard Biesheuvel 2022-06-20 390 goto free;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 391
2d82e6227ea189 Ard Biesheuvel 2022-06-20 392 /*
f45812cc23fb74 Tim Schumacher 2024-01-26 393 * A small set of old UEFI implementations reject sizes
f45812cc23fb74 Tim Schumacher 2024-01-26 394 * above a certain threshold, the lowest seen in the wild
f45812cc23fb74 Tim Schumacher 2024-01-26 395 * is 512.
2d82e6227ea189 Ard Biesheuvel 2022-06-20 396 */
2d82e6227ea189 Ard Biesheuvel 2022-06-20 397
2d82e6227ea189 Ard Biesheuvel 2022-06-20 398 do {
f45812cc23fb74 Tim Schumacher 2024-01-26 399 variable_name_size = 512;
cda30c6542c8bb Tim Schumacher 2024-03-28 400 BUILD_BUG_ON(EFI_VAR_NAME_LEN < 512);
2d82e6227ea189 Ard Biesheuvel 2022-06-20 401
2d82e6227ea189 Ard Biesheuvel 2022-06-20 402 status = efivar_get_next_variable(&variable_name_size,
2d82e6227ea189 Ard Biesheuvel 2022-06-20 403 variable_name,
2d82e6227ea189 Ard Biesheuvel 2022-06-20 404 &vendor_guid);
2d82e6227ea189 Ard Biesheuvel 2022-06-20 405 switch (status) {
2d82e6227ea189 Ard Biesheuvel 2022-06-20 406 case EFI_SUCCESS:
2d82e6227ea189 Ard Biesheuvel 2022-06-20 407 variable_name_size = var_name_strnsize(variable_name,
2d82e6227ea189 Ard Biesheuvel 2022-06-20 408 variable_name_size);
2d82e6227ea189 Ard Biesheuvel 2022-06-20 409
2d82e6227ea189 Ard Biesheuvel 2022-06-20 410 /*
2d82e6227ea189 Ard Biesheuvel 2022-06-20 411 * Some firmware implementations return the
2d82e6227ea189 Ard Biesheuvel 2022-06-20 412 * same variable name on multiple calls to
2d82e6227ea189 Ard Biesheuvel 2022-06-20 413 * get_next_variable(). Terminate the loop
2d82e6227ea189 Ard Biesheuvel 2022-06-20 414 * immediately as there is no guarantee that
2d82e6227ea189 Ard Biesheuvel 2022-06-20 415 * we'll ever see a different variable name,
2d82e6227ea189 Ard Biesheuvel 2022-06-20 416 * and may end up looping here forever.
2d82e6227ea189 Ard Biesheuvel 2022-06-20 417 */
43039cdd1a14ed James Bottomley 2025-01-07 418 if (duplicate_check &&
43039cdd1a14ed James Bottomley 2025-01-07 419 efivarfs_variable_is_present(variable_name,
4ec7bd5db9a1f6 James Bottomley 2025-01-06 420 &vendor_guid, data)) {
2d82e6227ea189 Ard Biesheuvel 2022-06-20 421 dup_variable_bug(variable_name, &vendor_guid,
2d82e6227ea189 Ard Biesheuvel 2022-06-20 422 variable_name_size);
2d82e6227ea189 Ard Biesheuvel 2022-06-20 423 status = EFI_NOT_FOUND;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 424 } else {
2d82e6227ea189 Ard Biesheuvel 2022-06-20 425 err = func(variable_name, vendor_guid,
b538f1e229e58c James Bottomley 2025-01-06 426 variable_name_size, data);
2d82e6227ea189 Ard Biesheuvel 2022-06-20 427 if (err)
2d82e6227ea189 Ard Biesheuvel 2022-06-20 428 status = EFI_NOT_FOUND;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 429 }
2d82e6227ea189 Ard Biesheuvel 2022-06-20 430 break;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 431 case EFI_UNSUPPORTED:
2d82e6227ea189 Ard Biesheuvel 2022-06-20 432 err = -EOPNOTSUPP;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 433 status = EFI_NOT_FOUND;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 434 break;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 435 case EFI_NOT_FOUND:
2d82e6227ea189 Ard Biesheuvel 2022-06-20 436 break;
f45812cc23fb74 Tim Schumacher 2024-01-26 437 case EFI_BUFFER_TOO_SMALL:
f45812cc23fb74 Tim Schumacher 2024-01-26 438 pr_warn("efivars: Variable name size exceeds maximum (%lu > 512)\n",
f45812cc23fb74 Tim Schumacher 2024-01-26 439 variable_name_size);
f45812cc23fb74 Tim Schumacher 2024-01-26 440 status = EFI_NOT_FOUND;
f45812cc23fb74 Tim Schumacher 2024-01-26 441 break;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 442 default:
f45812cc23fb74 Tim Schumacher 2024-01-26 443 pr_warn("efivars: get_next_variable: status=%lx\n", status);
2d82e6227ea189 Ard Biesheuvel 2022-06-20 444 status = EFI_NOT_FOUND;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 445 break;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 446 }
2d82e6227ea189 Ard Biesheuvel 2022-06-20 447
2d82e6227ea189 Ard Biesheuvel 2022-06-20 448 } while (status != EFI_NOT_FOUND);
2d82e6227ea189 Ard Biesheuvel 2022-06-20 449
2d82e6227ea189 Ard Biesheuvel 2022-06-20 450 efivar_unlock();
2d82e6227ea189 Ard Biesheuvel 2022-06-20 451 free:
2d82e6227ea189 Ard Biesheuvel 2022-06-20 452 kfree(variable_name);
2d82e6227ea189 Ard Biesheuvel 2022-06-20 453
2d82e6227ea189 Ard Biesheuvel 2022-06-20 454 return err;
2d82e6227ea189 Ard Biesheuvel 2022-06-20 455 }
2d82e6227ea189 Ard Biesheuvel 2022-06-20 456
:::::: The code at line 375 was first introduced by commit
:::::: 2d82e6227ea189c0589e7383a36616ac2a2d248c efi: vars: Move efivar caching layer into efivarfs
:::::: TO: Ard Biesheuvel <ardb@kernel.org>
:::::: CC: Ard Biesheuvel <ardb@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: fs/efivarfs/vars.c:375: warning: Function parameter or struct member 'duplicate_check' not described in 'efivar_init'
2025-01-09 21:02 fs/efivarfs/vars.c:375: warning: Function parameter or struct member 'duplicate_check' not described in 'efivar_init' kernel test robot
@ 2025-01-09 21:52 ` James Bottomley
2025-01-09 22:22 ` Ard Biesheuvel
0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2025-01-09 21:52 UTC (permalink / raw)
To: kernel test robot; +Cc: oe-kbuild-all, linux-efi, Ard Biesheuvel
On Fri, 2025-01-10 at 05:02 +0800, kernel test robot wrote:
> tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
> head: 5e948d5cefebebe2315faf356d7b5180144b17b0
> commit: 43039cdd1a14ed12c7b506a2d78c7fa708444b06 efivarfs: add
> variable resync after hibernation
> date: 11 hours ago
> config: x86_64-buildonly-randconfig-002-20250109
> (https://download.01.org/0day-ci/archive/20250110/202501100429.RSwlJM
> m0-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce (this is a W=1 build):
> (https://download.01.org/0day-ci/archive/20250110/202501100429.RSwlJM
> m0-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/oe-kbuild-all/202501100429.RSwlJMm0-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> > > fs/efivarfs/vars.c:375: warning: Function parameter or struct
> > > member 'duplicate_check' not described in 'efivar_init'
Sorry, my fault. If you fold this one-liner into "efivarfs: add
variable resync after hibernation" it will correct the warning.
James
---
diff --git a/fs/efivarfs/vars.c b/fs/efivarfs/vars.c
index d720d780648b..6edc10958ecf 100644
--- a/fs/efivarfs/vars.c
+++ b/fs/efivarfs/vars.c
@@ -364,6 +364,7 @@ static void dup_variable_bug(efi_char16_t *str16, efi_guid_t *vendor_guid,
* efivar_init - build the initial list of EFI variables
* @func: callback function to invoke for every variable
* @data: function-specific data to pass to @func
+ * @duplicate_check: fail if a duplicate variable is found
*
* Get every EFI variable from the firmware and invoke @func. @func
* should populate the initial dentry and inode tree.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: fs/efivarfs/vars.c:375: warning: Function parameter or struct member 'duplicate_check' not described in 'efivar_init'
2025-01-09 21:52 ` James Bottomley
@ 2025-01-09 22:22 ` Ard Biesheuvel
0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2025-01-09 22:22 UTC (permalink / raw)
To: James Bottomley; +Cc: kernel test robot, oe-kbuild-all, linux-efi
On Thu, 9 Jan 2025 at 22:52, James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:
>
> On Fri, 2025-01-10 at 05:02 +0800, kernel test robot wrote:
> > tree:
> > https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
> > head: 5e948d5cefebebe2315faf356d7b5180144b17b0
> > commit: 43039cdd1a14ed12c7b506a2d78c7fa708444b06 efivarfs: add
> > variable resync after hibernation
> > date: 11 hours ago
> > config: x86_64-buildonly-randconfig-002-20250109
> > (https://download.01.org/0day-ci/archive/20250110/202501100429.RSwlJM
> > m0-lkp@intel.com/config)
> > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> > reproduce (this is a W=1 build):
> > (https://download.01.org/0day-ci/archive/20250110/202501100429.RSwlJM
> > m0-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/oe-kbuild-all/202501100429.RSwlJMm0-lkp@intel.com/
> >
> > All warnings (new ones prefixed by >>):
> >
> > > > fs/efivarfs/vars.c:375: warning: Function parameter or struct
> > > > member 'duplicate_check' not described in 'efivar_init'
>
> Sorry, my fault. If you fold this one-liner into "efivarfs: add
> variable resync after hibernation" it will correct the warning.
>
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-09 22:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 21:02 fs/efivarfs/vars.c:375: warning: Function parameter or struct member 'duplicate_check' not described in 'efivar_init' kernel test robot
2025-01-09 21:52 ` James Bottomley
2025-01-09 22:22 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox