]> 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)
commit623d6b119e36949169520757d64bd3b3242de17f
tree5973b7c7a6f0220c075df1d7fe235355d6c6177f
parent7a2c9c7f5ebda8c808ac86d46d2fde3eb6f3ee8d
efi/libstub/file: Merge file name buffers to reduce stack usage

Arnd reports that commit

  44deaccf3177 ("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