]> git.baikalelectronics.ru Git - kernel.git/commit
efi/libstub/file: Merge file name buffers to reduce stack usage
authorArd Biesheuvel <ardb@kernel.org>
Thu, 9 Apr 2020 13:04:32 +0000 (15:04 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 14 Apr 2020 06:32:15 +0000 (08:32 +0200)
commit5861a674788eacd5d238c806bbb990dda5e6e765
tree5973b7c7a6f0220c075df1d7fe235355d6c6177f
parente09d8072fafad15c303256becccce4e9ea7f0670
efi/libstub/file: Merge file name buffers to reduce stack usage

Arnd reports that commit

  fe8ecd2b101a ("efi/libstub: Rewrite file I/O routine")

reworks the file I/O routines in a way that triggers the following
warning:

  drivers/firmware/efi/libstub/file.c:240:1: warning: the frame size
            of 1200 bytes is larger than 1024 bytes [-Wframe-larger-than=]

We can work around this issue dropping an instance of efi_char16_t[256]
from the stack frame, and reusing the 'filename' field of the file info
struct that we use to obtain file information from EFI (which contains
the file name even though we already know it since we used it to open
the file in the first place)

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200409130434.6736-8-ardb@kernel.org
drivers/firmware/efi/libstub/file.c