]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
firmware_loader: EFI firmware loader must handle pre-allocated buffer
authorKees Cook <keescook@chromium.org>
Fri, 24 Jul 2020 21:36:24 +0000 (14:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:18 +0000 (08:24 +0200)
commit3f29275098737306d6597ad7fd6983633120722b
tree84cc8aa436c07a90d2b42fab0d69bf4d2396694a
parent94bab54503b65810226a76b1f75c1a602cc2de10
firmware_loader: EFI firmware loader must handle pre-allocated buffer

commit 4fb60b158afd3ac9e0fe9975aa476213f5cc0a4d upstream.

The EFI platform firmware fallback would clobber any pre-allocated
buffers. Instead, correctly refuse to reallocate when too small (as
already done in the sysfs fallback), or perform allocation normally
when needed.

Fixes: e4c2c0ff00ec ("firmware: Add new platform fallback mechanism and firmware_request_platform()")
Cc: stable@vger.kernel.org
Acked-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20200724213640.389191-4-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_loader/fallback_platform.c