Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address -Warray-bounds warning in drivers/firmware/efi/libstub/zboot.c #327

Open
GustavoARSilva opened this issue Jun 27, 2023 · 0 comments

Comments

@GustavoARSilva
Copy link
Collaborator

Found after building ARM64 with allmodconfig:

In function 'get_unaligned_le32',
    inlined from 'efi_zboot_entry' at drivers/firmware/efi/libstub/zboot.c:93:15:
include/asm-generic/unaligned.h:14:15: warning: array subscript -1 is outside array bounds of 'char[]' [-Warray-bounds=]
   14 |         __pptr->x;                                                              \
      |         ~~~~~~^~~
include/uapi/linux/byteorder/little_endian.h:35:51: note: in definition of macro '__le32_to_cpu'
   35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
      |                                                   ^
include/asm-generic/unaligned.h:32:28: note: in expansion of macro '__get_unaligned_t'
   32 |         return le32_to_cpu(__get_unaligned_t(__le32, p));
      |                            ^~~~~~~~~~~~~~~~~
drivers/firmware/efi/libstub/zboot.c: In function 'efi_zboot_entry':
drivers/firmware/efi/libstub/zboot.c:33:30: note: at offset -4 into object '_gzdata_end' of size [0, 9223372036854775807]
   33 | extern char _gzdata_start[], _gzdata_end[];
      |                              ^~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant