All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/13] error: Do compile-time format string checking on grub_error
@ 2021-02-19  2:47 Glenn Washburn
  2021-02-19  2:47 ` [PATCH v4 01/13] misc: Format string for grub_error should be a literal Glenn Washburn
                   ` (15 more replies)
  0 siblings, 16 replies; 62+ messages in thread
From: Glenn Washburn @ 2021-02-19  2:47 UTC (permalink / raw)
  To: grub-devel; +Cc: Daniel Kiper, Glenn Washburn

This patch series fixes all compile errors due to format string issues on
grub_error. This was tested against nearly all supported platforms
successfully. This is important because earlier versions of these changes
compiled successfully on x86 platforms, but had issues on other ones not
tested.

All patches except the last fix actual format string issues. The last patch
turns format string issues into errors. This is a good idea because it will
help to prevent introducing new format string issues into the code. Since, I
presume, Daniel does not do not do a build test for all architectures before
committing to master, this will not ensure that no format string issues get
introduced into the code. However, it should flush out any format string
issues when the CI build is done.

Many of these changes are fairly obvious. I tried to use the PRI*GRUB_*_T
macros as much as I could and to not cast arguments. There are some notable
exceptions. There is some code that uses the same grub_error code in both
32 and 64 bit architectures (riscv), so casting was needed to force the larger
storage type. The second to last patch for zfs is still confounding to me
as to why the macro PRIuGRUB_UINT64_T was not expanding to llu, and yet the
compiler was saying the argument was a long long unsigned.

The tests results can be found here:
  https://gitlab.com/gwashburn/grub/-/pipelines/255133408

Glenn

Glenn Washburn (13):
  misc: Format string for grub_error should be a literal
  error: grub_error missing format string argument
  error: grub_error format string add missing format code
  dmraid_nvidia: Format string error in grub_error
  grub_error: Use format code PRIuGRUB_SIZE for variables of type
    grub_size_t
  pgp: Format code for grub_error is incorrect
  efi: Format string error in grub_error
  error: Use %p format code for pointer types
  error: Use format code PRIxGRUB_UINT64_T for 64-bit uint argument in
    grub_error
  error: Use format code PRIxGRUB_UINT64_T for 64-bit arg in grub_error
  error: Use format code PRIuGRUB_UINT64_T for 64-bit typed fileblock in
    grub_error
  error: Use format code llu for 64-bit uint bp->blk_prop in grub_error
  error: Do compile-time format string checking on grub_error

 grub-core/commands/pgp.c           |  2 +-
 grub-core/disk/ata.c               |  4 ++--
 grub-core/disk/cryptodisk.c        | 12 ++++++++----
 grub-core/disk/dmraid_nvidia.c     |  2 +-
 grub-core/efiemu/i386/loadcore64.c |  3 ++-
 grub-core/fs/hfsplus.c             |  3 ++-
 grub-core/fs/zfs/zfs.c             |  4 ++--
 grub-core/kern/arm64/dl.c          |  3 ++-
 grub-core/kern/efi/efi.c           |  2 +-
 grub-core/kern/efi/mm.c            |  5 +++--
 grub-core/kern/ia64/dl.c           |  3 ++-
 grub-core/kern/riscv/dl.c          |  5 +++--
 grub-core/kern/sparc64/dl.c        |  3 ++-
 grub-core/kern/x86_64/dl.c         |  3 ++-
 grub-core/loader/efi/chainloader.c |  4 ++--
 grub-core/loader/i386/bsd.c        |  3 ++-
 grub-core/loader/i386/pc/linux.c   |  4 ++--
 grub-core/net/tftp.c               |  2 +-
 grub-core/parttool/msdospart.c     |  4 ++--
 grub-core/script/lexer.c           |  2 +-
 grub-core/video/bochs.c            |  4 ++--
 include/grub/err.h                 |  3 ++-
 22 files changed, 47 insertions(+), 33 deletions(-)

-- 
2.27.0



^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2021-03-09 21:04 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19  2:47 [PATCH v4 00/13] error: Do compile-time format string checking on grub_error Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 01/13] misc: Format string for grub_error should be a literal Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 02/13] error: grub_error missing format string argument Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 03/13] error: grub_error format string add missing format code Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 04/13] dmraid_nvidia: Format string error in grub_error Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 05/13] grub_error: Use format code PRIuGRUB_SIZE for variables of type grub_size_t Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 06/13] pgp: Format code for grub_error is incorrect Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 07/13] efi: Format string error in grub_error Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 08/13] error: Use %p format code for pointer types Glenn Washburn
2021-02-27 11:43   ` Daniel Kiper
2021-02-28 20:02     ` Glenn Washburn
2021-03-03 18:05       ` Daniel Kiper
2021-02-19  2:47 ` [PATCH v4 09/13] error: Use format code PRIxGRUB_UINT64_T for 64-bit uint argument in grub_error Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 10/13] error: Use format code PRIxGRUB_UINT64_T for 64-bit arg " Glenn Washburn
2021-02-27 11:48   ` Daniel Kiper
2021-02-28 20:13     ` Glenn Washburn
2021-03-03 18:09       ` Daniel Kiper
2021-02-19  2:47 ` [PATCH v4 11/13] error: Use format code PRIuGRUB_UINT64_T for 64-bit typed fileblock " Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 12/13] error: Use format code llu for 64-bit uint bp->blk_prop " Glenn Washburn
2021-02-27 12:05   ` Daniel Kiper
2021-02-28 21:10     ` Glenn Washburn
2021-03-03 18:17       ` Daniel Kiper
2021-03-04  0:46         ` Glenn Washburn
2021-02-19  2:47 ` [PATCH v4 13/13] error: Do compile-time format string checking on grub_error Glenn Washburn
2021-02-27 12:19 ` [PATCH v4 00/13] " Daniel Kiper
2021-02-28 20:31   ` Glenn Washburn
2021-03-04  1:29 ` [PATCH v5 " Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 01/13] misc: Format string for grub_error should be a literal Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 02/13] error: grub_error missing format string argument Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 03/13] error: grub_error format string add missing format code Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 04/13] dmraid_nvidia: Format string error in grub_error Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 05/13] grub_error: Use format code PRIuGRUB_SIZE for variables of type grub_size_t Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 06/13] pgp: Format code for grub_error is incorrect Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 07/13] efi: Format string error in grub_error Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 08/13] error: Use PRI* macros to get correct format string code across architectures Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 09/13] error: Use format code PRIxGRUB_UINT64_T for 64-bit uint argument in grub_error Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 10/13] error: Use format code PRIxGRUB_UINT64_T for 64-bit arg " Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 11/13] error: Use format code PRIuGRUB_UINT64_T for 64-bit typed fileblock " Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 12/13] error: Use format code llu for 64-bit uint bp->blk_prop " Glenn Washburn
2021-03-04 17:59     ` Daniel Kiper
2021-03-04 22:50       ` Glenn Washburn
2021-03-04  1:29   ` [PATCH v5 13/13] error: Do compile-time format string checking on grub_error Glenn Washburn
2021-03-05  0:22 ` [PATCH v6 00/14] error: Do compile-time format string checking on grub> Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 01/14] misc: Format string for grub_error should be a literal Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 02/14] error: grub_error missing format string argument Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 03/14] error: grub_error format string add missing format code Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 04/14] dmraid_nvidia: Format string error in grub_error Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 05/14] grub_error: Use format code PRIuGRUB_SIZE for variables of type grub_size_t Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 06/14] pgp: Format code for grub_error is incorrect Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 07/14] efi: Format string error in grub_error Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 08/14] error: Use PRI* macros to get correct format string code across architectures Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 09/14] error: Use format code PRIxGRUB_UINT64_T for 64-bit uint argument in grub_error Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 10/14] error: Use format code PRIxGRUB_UINT64_T for 64-bit arg " Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 11/14] error: Use format code PRIuGRUB_UINT64_T for 64-bit typed fileblock " Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 12/14] error: Use format code llu for 64-bit uint bp->blk_prop " Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 13/14] error: Do compile-time format string checking on grub_error Glenn Washburn
2021-03-05  0:22   ` [PATCH v6 14/14] zfs: Use grub_uint64_t instead of 1ULL in BF64_*CODE macros Glenn Washburn
2021-03-05 16:27   ` [PATCH v6 00/14] error: Do compile-time format string checking on grub> Daniel Kiper
2021-03-05 23:15     ` Glenn Washburn
2021-03-06  6:59       ` Threading of patch series (was: [PATCH v6 00/14] error: Do compile-time format string checking on grub>) Paul Menzel
2021-03-07 21:00         ` Glenn Washburn
2021-03-09 21:04           ` Konrad Rzeszutek Wilk

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.