diff options
| author | Ard Biesheuvel <ardb@kernel.org> | 2026-03-26 14:26:57 +0100 |
|---|---|---|
| committer | Ard Biesheuvel <ardb@kernel.org> | 2026-04-09 16:27:52 +0200 |
| commit | 5d0faa8e8369b9a48498f6f132c2ced5f0549acc (patch) | |
| tree | bcc00a6d986ec493a5db3018644e5e1caff4121d /samples/workqueue/stall_detector/git@git.tavy.me:linux.git | |
| parent | 56e2ef8f5f9161d08d45656d373da83d4a789be1 (diff) | |
efi/memattr: Fix thinko in table size sanity check
While it is true that each PE/COFF runtime driver in memory can
generally be split into 3 different regions (the header, the code/rodata
region and the data/bss region), each with different permissions, it
does not mean that 3x the size of the memory map is a suitable upper
bound. This is due to the fact that all runtime drivers could be
coalesced into a single EFI runtime code region by the firmware, and if
the firmware does a good job of keeping the fragmentation down, it is
conceivable that the memory attributes table has more entries than the
EFI memory map itself.
So instead, base the sanity check on whether the descriptor size matches
the EFI memory map's descriptor size closely enough (which is not
mandated by the spec but extremely unlikely to differ in practice), and
whether the size of the whole table does not exceed 64k entries.
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'samples/workqueue/stall_detector/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
