From bcb86cf085b71f927d2d5d8393c2d2c096bf1f32 Mon Sep 17 00:00:00 2001 From: Will Sowerbutts Date: Sun, 22 Feb 2015 17:58:45 +0000 Subject: [PATCH] Kernel: Bug fix: _execve() did not dereference executable's inode when successful. --- Kernel/syscall_exec16.c | 1 + Kernel/syscall_exec32.c | 1 + 2 files changed, 2 insertions(+) diff --git a/Kernel/syscall_exec16.c b/Kernel/syscall_exec16.c index e84c72a7..f39d20fa 100644 --- a/Kernel/syscall_exec16.c +++ b/Kernel/syscall_exec16.c @@ -214,6 +214,7 @@ arg_t _execve(void) brelse(abuf); brelse(ebuf); + i_deref(ino); // Shove argc and the address of argv just below envp #ifdef CONFIG_CALL_R2L /* Arguments are stacked the 'wrong' way around */ diff --git a/Kernel/syscall_exec32.c b/Kernel/syscall_exec32.c index 13c96a30..7d018e1d 100644 --- a/Kernel/syscall_exec32.c +++ b/Kernel/syscall_exec32.c @@ -239,6 +239,7 @@ arg_t _execve(void) kfree(abuf); kfree(ebuf); + i_deref(ino); /* Shove argc and the address of argv just below envp */ uputl((uint32_t) nargv, nenvp - 1); -- 2.34.1