aboutsummaryrefslogtreecommitdiff
path: root/drivers/virt
diff options
context:
space:
mode:
authorGravatar Ard Biesheuvel <ardb@kernel.org> 2024-01-25 14:32:07 +0100
committerGravatar Ard Biesheuvel <ardb@kernel.org> 2024-03-09 11:37:18 +0100
commit9c55461040a9264b7e44444c53d26480b438eda6 (patch)
tree87cbfd816dc4a7b9bcae5ae13e0ec2fe0dd745ed /drivers/virt
parentefi/libstub: Add get_event_log() support for CC platforms (diff)
downloadlinux-9c55461040a9264b7e44444c53d26480b438eda6.tar.gz
linux-9c55461040a9264b7e44444c53d26480b438eda6.tar.bz2
linux-9c55461040a9264b7e44444c53d26480b438eda6.zip
x86/efistub: Remap kernel text read-only before dropping NX attribute
Currently, the EFI stub invokes the EFI memory attributes protocol to strip any NX restrictions from the entire loaded kernel, resulting in all code and data being mapped read-write-execute. The point of the EFI memory attributes protocol is to remove the need for all memory allocations to be mapped with both write and execute permissions by default, and make it the OS loader's responsibility to transition data mappings to code mappings where appropriate. Even though the UEFI specification does not appear to leave room for denying memory attribute changes based on security policy, let's be cautious and avoid relying on the ability to create read-write-execute mappings. This is trivially achievable, given that the amount of kernel code executing via the firmware's 1:1 mapping is rather small and limited to the .head.text region. So let's drop the NX restrictions only on that subregion, but not before remapping it as read-only first. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/virt')
0 files changed, 0 insertions, 0 deletions