|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen stable-4.20] x86/mkelf32: correct off-by-1 in empty PHDR checking loop
commit 7195dd9c3a6ebd13702a859d683c41ec7675272a
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Nov 25 14:43:47 2026 +0100
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Nov 25 14:43:47 2026 +0100
x86/mkelf32: correct off-by-1 in empty PHDR checking loop
To read the trailing PHDR, we need to seek to its start position within
the file, not its ending one.
Fixes: 54279f87ecbc ("x86/build: make linking work again with ld incapable
of generating build ID")
Reported-by: Roger Pau Monné <roger.pau@xxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
master commit: 033a241688d2f340df6301d1d31e2cda842911c4
master date: 2026-11-25 09:44:04 +0100
---
xen/arch/x86/boot/mkelf32.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c
index 044bbcb0c1..15677165e2 100644
--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -318,7 +318,8 @@ int main(int argc, char **argv)
while ( in64_ehdr.e_phnum > num_phdrs )
{
(void)lseek(infd,
- in64_ehdr.e_phoff + in64_ehdr.e_phnum * sizeof(in64_phdr),
+ in64_ehdr.e_phoff + (in64_ehdr.e_phnum - 1) *
+ sizeof(in64_phdr),
SEEK_SET);
do_read(infd, &in64_phdr, sizeof(in64_phdr));
endianadjust_phdr64(&in64_phdr);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |