summaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-07 15:45:24 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-07 15:45:24 +0000
commit9f9f3e6e8548a596697778337110a423c384b6f3 (patch)
tree5dd4b290ef532cf5ecb058e1a92cd3435afeac8c /fs/exec.c
parentd5c9a365ee7d2fded249aa5abfc5e89587583029 (diff)
Merge with Linux 2.3.49.
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 886e9ab8c..694bba675 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -277,13 +277,13 @@ void put_dirty_page(struct task_struct * tsk, struct page *page, unsigned long a
pmd = pmd_alloc(pgd, address);
if (!pmd) {
__free_page(page);
- oom(tsk);
+ force_sig(SIGKILL, tsk);
return;
}
pte = pte_alloc(pmd, address);
if (!pte) {
__free_page(page);
- oom(tsk);
+ force_sig(SIGKILL, tsk);
return;
}
if (!pte_none(*pte)) {
@@ -738,14 +738,18 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
char * dynloader[] = { "/sbin/loader" };
struct dentry * dentry;
+ lock_kernel();
dput(bprm->dentry);
+ unlock_kernel();
bprm->dentry = NULL;
bprm_loader.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
for (i = 0 ; i < MAX_ARG_PAGES ; i++) /* clear page-table */
bprm_loader.page[i] = NULL;
+ lock_kernel();
dentry = open_namei(dynloader[0], 0, 0);
+ unlock_kernel();
retval = PTR_ERR(dentry);
if (IS_ERR(dentry))
return retval;
@@ -766,8 +770,11 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
continue;
retval = fn(bprm, regs);
if (retval >= 0) {
- if (bprm->dentry)
+ if (bprm->dentry) {
+ lock_kernel();
dput(bprm->dentry);
+ unlock_kernel();
+ }
bprm->dentry = NULL;
current->did_exec = 1;
return retval;
@@ -810,7 +817,10 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0]));
+ lock_kernel();
dentry = open_namei(filename, 0, 0);
+ unlock_kernel();
+
retval = PTR_ERR(dentry);
if (IS_ERR(dentry))
return retval;
@@ -821,12 +831,16 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
bprm.loader = 0;
bprm.exec = 0;
if ((bprm.argc = count(argv, bprm.p / sizeof(void *))) < 0) {
+ lock_kernel();
dput(dentry);
+ unlock_kernel();
return bprm.argc;
}
if ((bprm.envc = count(envp, bprm.p / sizeof(void *))) < 0) {
+ lock_kernel();
dput(dentry);
+ unlock_kernel();
return bprm.envc;
}
@@ -854,8 +868,11 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
out:
/* Something went wrong, return the inode and free the argument pages*/
- if (bprm.dentry)
+ if (bprm.dentry) {
+ lock_kernel();
dput(bprm.dentry);
+ unlock_kernel();
+ }
/* Assumes that free_page() can take a NULL argument. */
/* I hope this is ok for all architectures */