test_firmware: Test platform fw loading on non-EFI systems
authorKees Cook <keescook@chromium.org>
Wed, 9 Sep 2020 22:53:54 +0000 (15:53 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2020 11:55:45 +0000 (13:55 +0200)
commitf17c2fe6ea89a007e72aed27d672d9e3c417d2b7
tree794297c282b2ae63a254c7faf83ffe7f36bbd7cd
parent46230cc3ff269a09ea86df8b1ea6d90db6758cf8
test_firmware: Test platform fw loading on non-EFI systems

commit baaabecfc80fad255f866563b53b8c7a3eec176e upstream.

On non-EFI systems, it wasn't possible to test the platform firmware
loader because it will have never set "checked_fw" during __init.
Instead, allow the test code to override this check. Additionally split
the declarations into a private symbol namespace so there is greater
enforcement of the symbol visibility.

Fixes: 548193cba2a7 ("test_firmware: add support for firmware_request_platform")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20200909225354.3118328-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/efi/embedded-firmware.c
include/linux/efi_embedded_fw.h
lib/test_firmware.c