Skip to contentSkip to conversation

drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier

PATCH In review Dan Carpenter 3 participants 6 messages May 20, 2020 EFI

lore
Share & tools
lore
#0 lore raw

PATCH 39/40 drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
commit: 85f5afd4322d294a7eca0d304744a1646113fbd9 [39/40] efi/libstub: Use snprintf with %ls to convert the command line
config: x86_64-defconfig (attached as .config)

If you fix the issue, kindly add following tag as appropriate

New smatch warnings:
drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier

# https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=85f5afd4322d294a7eca0d304744a1646113fbd9
git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git remote update efi
git checkout 85f5afd4322d294a7eca0d304744a1646113fbd9
vim +/l +265 drivers/firmware/efi/libstub/efi-stub-helper.c

c625d1c203941f drivers/firmware/efi/efi-stub-helper.c         H. Peter Anvin 2013-09-20  258  	options_bytes++;	/* NUL termination */
9403e462fb5ffa drivers/firmware/efi/efi-stub-helper.c         Leif Lindholm  2014-04-04  259  
1e45bf7372c48c drivers/firmware/efi/libstub/efi-stub-helper.c Ard Biesheuvel 2020-02-10  260  	status = efi_allocate_pages(options_bytes, &cmdline_addr, max_addr);
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  261  	if (status != EFI_SUCCESS)
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  262  		return NULL;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  263  
85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar  2020-05-18  264  	snprintf((char *)cmdline_addr, options_bytes, "%.*ls",
                                                                                                                                                  ^

The "l" doesn't make sense here?

85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar 2020-05-18 @265 options_bytes - 1, options);

5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  266  
c625d1c203941f drivers/firmware/efi/efi-stub-helper.c         H. Peter Anvin 2013-09-20  267  	*cmd_line_len = options_bytes;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  268  	return (char *)cmdline_addr;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  269  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#1 lore raw
Quoted 26 lines · Dan Carpenter
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
commit: 85f5afd4322d294a7eca0d304744a1646113fbd9 [39/40] efi/libstub: Use snprintf with %ls to convert the command line
config: x86_64-defconfig (attached as .config)

If you fix the issue, kindly add following tag as appropriate

New smatch warnings:
drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier

# https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=85f5afd4322d294a7eca0d304744a1646113fbd9
git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git remote update efi
git checkout 85f5afd4322d294a7eca0d304744a1646113fbd9
vim +/l +265 drivers/firmware/efi/libstub/efi-stub-helper.c

c625d1c203941f drivers/firmware/efi/efi-stub-helper.c         H. Peter Anvin 2013-09-20  258  	options_bytes++;	/* NUL termination */
9403e462fb5ffa drivers/firmware/efi/efi-stub-helper.c         Leif Lindholm  2014-04-04  259  
1e45bf7372c48c drivers/firmware/efi/libstub/efi-stub-helper.c Ard Biesheuvel 2020-02-10  260  	status = efi_allocate_pages(options_bytes, &cmdline_addr, max_addr);
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  261  	if (status != EFI_SUCCESS)
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  262  		return NULL;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  263  
85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar  2020-05-18  264  	snprintf((char *)cmdline_addr, options_bytes, "%.*ls",
                                                                                                                                                  ^
Quoted 1 line

The "l" doesn't make sense here?

The previous patches add support for wide strings to the version of snprintf used here.

Quoted 10 lines

85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar 2020-05-18 @265 options_bytes - 1, options);

5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  266  
c625d1c203941f drivers/firmware/efi/efi-stub-helper.c         H. Peter Anvin 2013-09-20  267  	*cmd_line_len = options_bytes;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  268  	return (char *)cmdline_addr;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  269  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

#2 lore raw
Quoted 29 lines · Arvind Sankar
Quoted 26 lines · Dan Carpenter
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
commit: 85f5afd4322d294a7eca0d304744a1646113fbd9 [39/40] efi/libstub: Use snprintf with %ls to convert the command line
config: x86_64-defconfig (attached as .config)

If you fix the issue, kindly add following tag as appropriate

New smatch warnings:
drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier

# https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=85f5afd4322d294a7eca0d304744a1646113fbd9
git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git remote update efi
git checkout 85f5afd4322d294a7eca0d304744a1646113fbd9
vim +/l +265 drivers/firmware/efi/libstub/efi-stub-helper.c

c625d1c203941f drivers/firmware/efi/efi-stub-helper.c         H. Peter Anvin 2013-09-20  258  	options_bytes++;	/* NUL termination */
9403e462fb5ffa drivers/firmware/efi/efi-stub-helper.c         Leif Lindholm  2014-04-04  259  
1e45bf7372c48c drivers/firmware/efi/libstub/efi-stub-helper.c Ard Biesheuvel 2020-02-10  260  	status = efi_allocate_pages(options_bytes, &cmdline_addr, max_addr);
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  261  	if (status != EFI_SUCCESS)
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  262  		return NULL;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  263  
85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar  2020-05-18  264  	snprintf((char *)cmdline_addr, options_bytes, "%.*ls",
                                                                                                                                                  ^
Quoted 1 line

The "l" doesn't make sense here?

Quoted 2 lines

The previous patches add support for wide strings to the version of snprintf used here.

Ah. Thanks. I will update the Smatch check.

regards,
dan carpenter

#3 lore raw
Quoted 30 lines · Dan Carpenter
Quoted 29 lines · Arvind Sankar
Quoted 27 lines · Dan Carpenter
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
commit: 85f5afd4322d294a7eca0d304744a1646113fbd9 [39/40] efi/libstub: Use snprintf with %ls to convert the command line
config: x86_64-defconfig (attached as .config)

If you fix the issue, kindly add following tag as appropriate

New smatch warnings:
drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier

# https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=85f5afd4322d294a7eca0d304744a1646113fbd9
git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git remote update efi
git checkout 85f5afd4322d294a7eca0d304744a1646113fbd9
vim +/l +265 drivers/firmware/efi/libstub/efi-stub-helper.c

c625d1c203941f drivers/firmware/efi/efi-stub-helper.c         H. Peter Anvin 2013-09-20  258  	options_bytes++;	/* NUL termination */
9403e462fb5ffa drivers/firmware/efi/efi-stub-helper.c         Leif Lindholm  2014-04-04  259  
1e45bf7372c48c drivers/firmware/efi/libstub/efi-stub-helper.c Ard Biesheuvel 2020-02-10  260  	status = efi_allocate_pages(options_bytes, &cmdline_addr, max_addr);
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  261  	if (status != EFI_SUCCESS)
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  262  		return NULL;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  263  
85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar  2020-05-18  264  	snprintf((char *)cmdline_addr, options_bytes, "%.*ls",
                                                                                                                                                  ^

The "l" doesn't make sense here?

Quoted 8 lines
Quoted 2 lines

The previous patches add support for wide strings to the version of snprintf used here.

Ah. Thanks. I will update the Smatch check.

regards,
dan carpenter

Note that the main kernel's printf still doesn't support it. It's only been added to the version in drivers/firmware/efi/libstub/vsprintf.c (added as part of this series).

maintainer
#4 lore raw
Quoted 35 lines · Arvind Sankar
Quoted 33 lines · Dan Carpenter
Quoted 31 lines · Arvind Sankar
Quoted 26 lines · Dan Carpenter
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
commit: 85f5afd4322d294a7eca0d304744a1646113fbd9 [39/40] efi/libstub: Use snprintf with %ls to convert the command line
config: x86_64-defconfig (attached as .config)

If you fix the issue, kindly add following tag as appropriate

New smatch warnings:
drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier

# https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=85f5afd4322d294a7eca0d304744a1646113fbd9
git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git remote update efi
git checkout 85f5afd4322d294a7eca0d304744a1646113fbd9
vim +/l +265 drivers/firmware/efi/libstub/efi-stub-helper.c

c625d1c203941f drivers/firmware/efi/efi-stub-helper.c         H. Peter Anvin 2013-09-20  258      options_bytes++;        /* NUL termination */
9403e462fb5ffa drivers/firmware/efi/efi-stub-helper.c         Leif Lindholm  2014-04-04  259
1e45bf7372c48c drivers/firmware/efi/libstub/efi-stub-helper.c Ard Biesheuvel 2020-02-10  260      status = efi_allocate_pages(options_bytes, &cmdline_addr, max_addr);
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  261      if (status != EFI_SUCCESS)
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  262              return NULL;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  263
85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar  2020-05-18  264      snprintf((char *)cmdline_addr, options_bytes, "%.*ls",
                                                                                                                                                  ^
Quoted 1 line

The "l" doesn't make sense here?

The previous patches add support for wide strings to the version of snprintf used here.

Quoted 8 lines
Quoted 5 lines

Ah. Thanks. I will update the Smatch check.

regards,
dan carpenter

Note that the main kernel's printf still doesn't support it. It's only been added to the version in drivers/firmware/efi/libstub/vsprintf.c (added as part of this series).

... which is justified, given how heavily EFI depends on UTF-16 support.

#5 lore raw
In reply to Arvind Sankar
Quoted 34 lines · Arvind Sankar
Quoted 33 lines · Dan Carpenter
Quoted 31 lines · Arvind Sankar
Quoted 26 lines · Dan Carpenter
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   e5fbadd1179cdadeaa44d71a9ec068c5bc100524
commit: 85f5afd4322d294a7eca0d304744a1646113fbd9 [39/40] efi/libstub: Use snprintf with %ls to convert the command line
config: x86_64-defconfig (attached as .config)

If you fix the issue, kindly add following tag as appropriate

New smatch warnings:
drivers/firmware/efi/libstub/efi-stub-helper.c:265 efi_convert_cmdline() warn: qualifier 'l' ignored for %s specifier

# https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=85f5afd4322d294a7eca0d304744a1646113fbd9
git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git remote update efi
git checkout 85f5afd4322d294a7eca0d304744a1646113fbd9
vim +/l +265 drivers/firmware/efi/libstub/efi-stub-helper.c

c625d1c203941f drivers/firmware/efi/efi-stub-helper.c         H. Peter Anvin 2013-09-20  258  	options_bytes++;	/* NUL termination */
9403e462fb5ffa drivers/firmware/efi/efi-stub-helper.c         Leif Lindholm  2014-04-04  259  
1e45bf7372c48c drivers/firmware/efi/libstub/efi-stub-helper.c Ard Biesheuvel 2020-02-10  260  	status = efi_allocate_pages(options_bytes, &cmdline_addr, max_addr);
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  261  	if (status != EFI_SUCCESS)
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  262  		return NULL;
5fef3870c572a3 drivers/firmware/efi/efi-stub-helper.c         Roy Franz      2013-09-22  263  
85f5afd4322d29 drivers/firmware/efi/libstub/efi-stub-helper.c Arvind Sankar  2020-05-18  264  	snprintf((char *)cmdline_addr, options_bytes, "%.*ls",
                                                                                                                                                  ^
Quoted 1 line

The "l" doesn't make sense here?

The previous patches add support for wide strings to the version of snprintf used here.

Quoted 8 lines
Quoted 5 lines

Ah. Thanks. I will update the Smatch check.

regards,
dan carpenter

Note that the main kernel's printf still doesn't support it. It's only been added to the version in drivers/firmware/efi/libstub/vsprintf.c (added as part of this series).

Ah... I looked and looked at lib/vsprintf.c and wondered if I was going mad. :P Thanks.

regards,
dan carpenter