]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
efi: libstub: Disable struct randomization
authorArd Biesheuvel <ardb@kernel.org>
Mon, 22 Aug 2022 17:20:33 +0000 (19:20 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 Nov 2022 14:11:02 +0000 (15:11 +0100)
commit048cf8e854702b769845b89d504870fcf74ef1da
treee8335068d9746d56836c7ec30f63528f055aba20
parent16e2ed60f505c661b24e1f72d43fc8f1f725a3dd
efi: libstub: Disable struct randomization

BugLink: https://bugs.launchpad.net/bugs/1993003
commit 1a3887924a7e6edd331be76da7bf4c1e8eab4b1e upstream.

The EFI stub is a wrapper around the core kernel that makes it look like
a EFI compatible PE/COFF application to the EFI firmware. EFI
applications run on top of the EFI runtime, which is heavily based on
so-called protocols, which are struct types consisting [mostly] of
function pointer members that are instantiated and recorded in a
protocol database.

These structs look like the ideal randomization candidates to the
randstruct plugin (as they only carry function pointers), but of course,
these protocols are contracts between the firmware that exposes them,
and the EFI applications (including our stubbed kernel) that invoke
them. This means that struct randomization for EFI protocols is not a
great idea, and given that the stub shares very little data with the
core kernel that is represented as a randomizable struct, we're better
off just disabling it completely here.

Cc: <stable@vger.kernel.org> # v4.14+
Reported-by: Daniel Marth <daniel.marth@inso.tuwien.ac.at>
Tested-by: Daniel Marth <daniel.marth@inso.tuwien.ac.at>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/firmware/efi/libstub/Makefile