execve: check for binaries too low to load
authorAlan Cox <alan@linux.intel.com>
Sat, 26 May 2018 10:16:02 +0000 (11:16 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 26 May 2018 10:16:02 +0000 (11:16 +0100)
This got broken when the changes were added to allow high address binaries
to be loaded into big memory windows.

The real fix is to go to relocatable binaries of course

Kernel/syscall_exec16.c

index d76eaf0..6414424 100644 (file)
@@ -105,7 +105,7 @@ arg_t _execve(void)
        /* FIXME: review overflows */
        bin_size = ino->c_node.i_size;
        progptr = bin_size + 1024 + bss;
-       if (top - progload < progptr || progptr < bin_size) {
+       if (progload < PROGLOAD || top - progload < progptr || progptr < bin_size) {
                udata.u_error = ENOMEM;
                goto nogood2;
        }