From 14671e3293a6e753f68e41bf09d384b3de202381 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 27 Dec 2014 12:51:41 +0000 Subject: [PATCH] execve: Fix ABI change on unsized binaries We need to adjust by the load page *after* we have checked for zero. --- Kernel/syscall_exec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Kernel/syscall_exec.c b/Kernel/syscall_exec.c index c25175a2..a9257903 100644 --- a/Kernel/syscall_exec.c +++ b/Kernel/syscall_exec.c @@ -76,9 +76,11 @@ int16_t _execve(void) * UZI binaries). */ if (buf[3] == 'F' && buf[4] == 'Z' && buf[5] == 'X' && buf[6] == '1') { - top = buf[8] | ((unsigned int)buf[9] << 8) - PROGLOAD; + top = buf[8] | ((unsigned int)buf[9] << 8); if (top == 0) /* Legacy 'all space' binary */ top = ramtop; + else /* Requested an amount, so adjust for the base */ + top += PROGLOAD; emu_ino = 0; // no emulation, thanks /* Don't load binaries for the wrong base page, eg spectrum binaries on a sane box */ -- 2.34.1