diff options
author | Sven Schnelle <svens@linux.ibm.com> | 2024-04-26 08:02:06 +0200 |
---|---|---|
committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2024-04-29 17:33:29 +0200 |
commit | fe742c08f3d930d62647412f602d2b4a211a0a39 (patch) | |
tree | 5598e03634840ad452e422b9924515b7532963d3 /arch/s390/include | |
parent | a2269a66eec37916e2bcc148b7f7ed398b66263f (diff) |
s390/os_info: Fix array size in struct os_info
gcc's -Warray-bounds warned about an out-of-bounds access to
the entry array contained in struct os_info. This doesn't trigger
a bug right now because there's a large reserved space after the
array. Nevertheless fix this, and also add a BUILD_BUG_ON to make
sure struct os_info is always exactly on page in size.
Fixes: f4cac27dc0d6 ("s390/crash: Use old os_info to create PT_LOAD headers")
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/os_info.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/s390/include/asm/os_info.h b/arch/s390/include/asm/os_info.h index dea2b37b635e..3ee9e8f5ceae 100644 --- a/arch/s390/include/asm/os_info.h +++ b/arch/s390/include/asm/os_info.h @@ -27,6 +27,7 @@ #define OS_INFO_IMAGE_START 10 #define OS_INFO_IMAGE_END 11 #define OS_INFO_IMAGE_PHYS 12 +#define OS_INFO_MAX 13 #define OS_INFO_FLAG_REIPL_CLEAR (1UL << 0) @@ -46,8 +47,8 @@ struct os_info { u16 version_minor; u64 crashkernel_addr; u64 crashkernel_size; - struct os_info_entry entry[10]; - u8 reserved[3864]; + struct os_info_entry entry[OS_INFO_MAX]; + u8 reserved[3804]; } __packed; void os_info_init(void); |