diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/compat.c | 4 | ||||
-rw-r--r-- | fs/exec.c | 10 | ||||
-rw-r--r-- | fs/file.c | 10 |
3 files changed, 9 insertions, 15 deletions
diff --git a/fs/compat.c b/fs/compat.c index ac3fb9ed8eea..a719e158e002 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #include <linux/nfsd/syscall.h> | 44 | #include <linux/nfsd/syscall.h> |
45 | #include <linux/personality.h> | 45 | #include <linux/personality.h> |
46 | #include <linux/rwsem.h> | 46 | #include <linux/rwsem.h> |
47 | #include <linux/acct.h> | ||
48 | #include <linux/mm.h> | ||
47 | 49 | ||
48 | #include <net/sock.h> /* siocdevprivate_ioctl */ | 50 | #include <net/sock.h> /* siocdevprivate_ioctl */ |
49 | 51 | ||
@@ -1487,6 +1489,8 @@ int compat_do_execve(char * filename, | |||
1487 | 1489 | ||
1488 | /* execve success */ | 1490 | /* execve success */ |
1489 | security_bprm_free(bprm); | 1491 | security_bprm_free(bprm); |
1492 | acct_update_integrals(current); | ||
1493 | update_mem_hiwater(current); | ||
1490 | kfree(bprm); | 1494 | kfree(bprm); |
1491 | return retval; | 1495 | return retval; |
1492 | } | 1496 | } |
@@ -421,11 +421,6 @@ int setup_arg_pages(struct linux_binprm *bprm, | |||
421 | if (!mpnt) | 421 | if (!mpnt) |
422 | return -ENOMEM; | 422 | return -ENOMEM; |
423 | 423 | ||
424 | if (security_vm_enough_memory(arg_size >> PAGE_SHIFT)) { | ||
425 | kmem_cache_free(vm_area_cachep, mpnt); | ||
426 | return -ENOMEM; | ||
427 | } | ||
428 | |||
429 | memset(mpnt, 0, sizeof(*mpnt)); | 424 | memset(mpnt, 0, sizeof(*mpnt)); |
430 | 425 | ||
431 | down_write(&mm->mmap_sem); | 426 | down_write(&mm->mmap_sem); |
@@ -745,8 +740,8 @@ static inline int de_thread(struct task_struct *tsk) | |||
745 | } | 740 | } |
746 | 741 | ||
747 | /* | 742 | /* |
748 | * Now there are really no other threads at all, | 743 | * There may be one thread left which is just exiting, |
749 | * so it's safe to stop telling them to kill themselves. | 744 | * but it's safe to stop telling the group to kill themselves. |
750 | */ | 745 | */ |
751 | sig->flags = 0; | 746 | sig->flags = 0; |
752 | 747 | ||
@@ -785,7 +780,6 @@ no_thread_group: | |||
785 | kmem_cache_free(sighand_cachep, oldsighand); | 780 | kmem_cache_free(sighand_cachep, oldsighand); |
786 | } | 781 | } |
787 | 782 | ||
788 | BUG_ON(!thread_group_empty(current)); | ||
789 | BUG_ON(!thread_group_leader(current)); | 783 | BUG_ON(!thread_group_leader(current)); |
790 | return 0; | 784 | return 0; |
791 | } | 785 | } |
@@ -69,13 +69,9 @@ void free_fd_array(struct file **array, int num) | |||
69 | 69 | ||
70 | static void __free_fdtable(struct fdtable *fdt) | 70 | static void __free_fdtable(struct fdtable *fdt) |
71 | { | 71 | { |
72 | int fdset_size, fdarray_size; | 72 | free_fdset(fdt->open_fds, fdt->max_fdset); |
73 | 73 | free_fdset(fdt->close_on_exec, fdt->max_fdset); | |
74 | fdset_size = fdt->max_fdset / 8; | 74 | free_fd_array(fdt->fd, fdt->max_fds); |
75 | fdarray_size = fdt->max_fds * sizeof(struct file *); | ||
76 | free_fdset(fdt->open_fds, fdset_size); | ||
77 | free_fdset(fdt->close_on_exec, fdset_size); | ||
78 | free_fd_array(fdt->fd, fdarray_size); | ||
79 | kfree(fdt); | 75 | kfree(fdt); |
80 | } | 76 | } |
81 | 77 | ||