]> git.baikalelectronics.ru Git - kernel.git/commit
x86/boot: Save fields explicitly, zero out everything else
authorJohn Hubbard <jhubbard@nvidia.com>
Wed, 31 Jul 2019 05:46:27 +0000 (22:46 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 16 Aug 2019 12:20:00 +0000 (14:20 +0200)
commit4c78ff4fcebfc34d9b5a1eb8d6c9225470e31401
tree7e3ef3805ffe0a7c4ee8b038002e0c4b063dec1f
parent5bd6ca4a5ca241e56122aee1cb85321cbf68ec94
x86/boot: Save fields explicitly, zero out everything else

Recent gcc compilers (gcc 9.1) generate warnings about an out of bounds
memset, if the memset goes accross several fields of a struct. This
generated a couple of warnings on x86_64 builds in sanitize_boot_params().

Fix this by explicitly saving the fields in struct boot_params
that are intended to be preserved, and zeroing all the rest.

[ tglx: Tagged for stable as it breaks the warning free build there as well ]

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Suggested-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20190731054627.5627-2-jhubbard@nvidia.com
arch/x86/include/asm/bootparam_utils.h