From: Alan Cox Date: Wed, 19 Apr 2017 23:13:42 +0000 (+0100) Subject: syscall_exec16: handle disk read failure on exec properly X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e6d0a20a2f0911542ad5d0a8d682fa33ba9cf9c8;p=FUZIX.git syscall_exec16: handle disk read failure on exec properly We now kill the process so we don't execute a misloaded image --- diff --git a/Kernel/syscall_exec16.c b/Kernel/syscall_exec16.c index 3ff1720e..bc8a65d6 100644 --- a/Kernel/syscall_exec16.c +++ b/Kernel/syscall_exec16.c @@ -210,7 +210,11 @@ arg_t _execve(void) if (bin_size > 512) { bin_size -= 512; - bload(ino, 1, progptr, bin_size); + if (bload(ino, 1, progptr, bin_size) < 0) { + /* Must not run userspace */ + ssig(udata.u_ptab, SIGKILL); + goto nogood3; + } progptr += bin_size; }