rhboot / shim

UEFI shim loader
Other
819 stars 289 forks source link

pe: Fix image section entry-point validation #518

Closed iokomin closed 1 year ago

iokomin commented 1 year ago

Seen mokmanager image load failure '2 sections contain entry point' for shim built on Oracle Linux 9 aarch64. found_entry_point counter in handle_image() uses SizeOfRawData to calculate section boundary. PE spec defines VirtualSize for the total size of the section when loaded into memory. SizeOfRawData is the size of the section (for object files) or the size of the initialized data on disk.

Fix this issue by updating section in-memory size limit to VirtualSize.

Resolves: #517 Signed-off-by: Ilya Okomin ilya.okomin@oracle.com