]> git.ipfire.org Git - thirdparty/systemd.git/commit
boot: bound PE section VirtualSize before zeroing the inner kernel
authorLuca Boccassi <luca.boccassi@gmail.com>
Fri, 26 Jun 2026 19:12:36 +0000 (20:12 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 3 Jul 2026 14:19:39 +0000 (15:19 +0100)
commitfeeba8fa3b77ae3e8f0c2bedda94e4dab23d85c7
treec9894ffdf81160c3d4881ad0aabd82635187d521
parentecf3f5056a74058fc60de91a7784ab01ce27dec8
boot: bound PE section VirtualSize before zeroing the inner kernel

The inner-kernel section loader checks VirtualAddress + SizeOfRawData
against kernel_size_in_memory (for the memcpy), but the memzero right
after it clears up to VirtualAddress + VirtualSize, and VirtualSize is
only constrained to be >= SizeOfRawData.

Reject a VirtualAddress + VirtualSize that overflows or exceeds
kernel_size_in_memory, mirroring the existing SizeOfRawData checks.

Follow-up for cab9c7b5a42effa8a45611fc6b8556138c869b5f
src/boot/linux.c