diff options
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 24 |
1 files changed, 12 insertions, 12 deletions
| @@ -324,7 +324,7 @@ void install_arg_page(struct vm_area_struct *vma, | |||
| 324 | lru_cache_add_active(page); | 324 | lru_cache_add_active(page); |
| 325 | set_pte_at(mm, address, pte, pte_mkdirty(pte_mkwrite(mk_pte( | 325 | set_pte_at(mm, address, pte, pte_mkdirty(pte_mkwrite(mk_pte( |
| 326 | page, vma->vm_page_prot)))); | 326 | page, vma->vm_page_prot)))); |
| 327 | page_add_anon_rmap(page, vma, address); | 327 | page_add_new_anon_rmap(page, vma, address); |
| 328 | pte_unmap_unlock(pte, ptl); | 328 | pte_unmap_unlock(pte, ptl); |
| 329 | 329 | ||
| 330 | /* no need for flush_tlb */ | 330 | /* no need for flush_tlb */ |
| @@ -477,7 +477,7 @@ struct file *open_exec(const char *name) | |||
| 477 | int err; | 477 | int err; |
| 478 | struct file *file; | 478 | struct file *file; |
| 479 | 479 | ||
| 480 | err = path_lookup_open(name, LOOKUP_FOLLOW, &nd, FMODE_READ); | 480 | err = path_lookup_open(AT_FDCWD, name, LOOKUP_FOLLOW, &nd, FMODE_READ); |
| 481 | file = ERR_PTR(err); | 481 | file = ERR_PTR(err); |
| 482 | 482 | ||
| 483 | if (!err) { | 483 | if (!err) { |
| @@ -575,7 +575,7 @@ static int exec_mmap(struct mm_struct *mm) | |||
| 575 | * disturbing other processes. (Other processes might share the signal | 575 | * disturbing other processes. (Other processes might share the signal |
| 576 | * table via the CLONE_SIGHAND option to clone().) | 576 | * table via the CLONE_SIGHAND option to clone().) |
| 577 | */ | 577 | */ |
| 578 | static inline int de_thread(struct task_struct *tsk) | 578 | static int de_thread(struct task_struct *tsk) |
| 579 | { | 579 | { |
| 580 | struct signal_struct *sig = tsk->signal; | 580 | struct signal_struct *sig = tsk->signal; |
| 581 | struct sighand_struct *newsighand, *oldsighand = tsk->sighand; | 581 | struct sighand_struct *newsighand, *oldsighand = tsk->sighand; |
| @@ -632,10 +632,10 @@ static inline int de_thread(struct task_struct *tsk) | |||
| 632 | * synchronize with any firing (by calling del_timer_sync) | 632 | * synchronize with any firing (by calling del_timer_sync) |
| 633 | * before we can safely let the old group leader die. | 633 | * before we can safely let the old group leader die. |
| 634 | */ | 634 | */ |
| 635 | sig->real_timer.data = (unsigned long)current; | 635 | sig->real_timer.data = current; |
| 636 | spin_unlock_irq(lock); | 636 | spin_unlock_irq(lock); |
| 637 | if (del_timer_sync(&sig->real_timer)) | 637 | if (hrtimer_cancel(&sig->real_timer)) |
| 638 | add_timer(&sig->real_timer); | 638 | hrtimer_restart(&sig->real_timer); |
| 639 | spin_lock_irq(lock); | 639 | spin_lock_irq(lock); |
| 640 | } | 640 | } |
| 641 | while (atomic_read(&sig->count) > count) { | 641 | while (atomic_read(&sig->count) > count) { |
| @@ -760,7 +760,7 @@ no_thread_group: | |||
| 760 | spin_lock(&oldsighand->siglock); | 760 | spin_lock(&oldsighand->siglock); |
| 761 | spin_lock(&newsighand->siglock); | 761 | spin_lock(&newsighand->siglock); |
| 762 | 762 | ||
| 763 | current->sighand = newsighand; | 763 | rcu_assign_pointer(current->sighand, newsighand); |
| 764 | recalc_sigpending(); | 764 | recalc_sigpending(); |
| 765 | 765 | ||
| 766 | spin_unlock(&newsighand->siglock); | 766 | spin_unlock(&newsighand->siglock); |
| @@ -768,7 +768,7 @@ no_thread_group: | |||
| 768 | write_unlock_irq(&tasklist_lock); | 768 | write_unlock_irq(&tasklist_lock); |
| 769 | 769 | ||
| 770 | if (atomic_dec_and_test(&oldsighand->count)) | 770 | if (atomic_dec_and_test(&oldsighand->count)) |
| 771 | kmem_cache_free(sighand_cachep, oldsighand); | 771 | sighand_free(oldsighand); |
| 772 | } | 772 | } |
| 773 | 773 | ||
| 774 | BUG_ON(!thread_group_leader(current)); | 774 | BUG_ON(!thread_group_leader(current)); |
| @@ -780,7 +780,7 @@ no_thread_group: | |||
| 780 | * so that a new one can be started | 780 | * so that a new one can be started |
| 781 | */ | 781 | */ |
| 782 | 782 | ||
| 783 | static inline void flush_old_files(struct files_struct * files) | 783 | static void flush_old_files(struct files_struct * files) |
| 784 | { | 784 | { |
| 785 | long j = -1; | 785 | long j = -1; |
| 786 | struct fdtable *fdt; | 786 | struct fdtable *fdt; |
| @@ -964,7 +964,7 @@ int prepare_binprm(struct linux_binprm *bprm) | |||
| 964 | 964 | ||
| 965 | EXPORT_SYMBOL(prepare_binprm); | 965 | EXPORT_SYMBOL(prepare_binprm); |
| 966 | 966 | ||
| 967 | static inline int unsafe_exec(struct task_struct *p) | 967 | static int unsafe_exec(struct task_struct *p) |
| 968 | { | 968 | { |
| 969 | int unsafe = 0; | 969 | int unsafe = 0; |
| 970 | if (p->ptrace & PT_PTRACED) { | 970 | if (p->ptrace & PT_PTRACED) { |
| @@ -1462,6 +1462,7 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
| 1462 | if (!(current->signal->flags & SIGNAL_GROUP_EXIT)) { | 1462 | if (!(current->signal->flags & SIGNAL_GROUP_EXIT)) { |
| 1463 | current->signal->flags = SIGNAL_GROUP_EXIT; | 1463 | current->signal->flags = SIGNAL_GROUP_EXIT; |
| 1464 | current->signal->group_exit_code = exit_code; | 1464 | current->signal->group_exit_code = exit_code; |
| 1465 | current->signal->group_stop_count = 0; | ||
| 1465 | retval = 0; | 1466 | retval = 0; |
| 1466 | } | 1467 | } |
| 1467 | spin_unlock_irq(¤t->sighand->siglock); | 1468 | spin_unlock_irq(¤t->sighand->siglock); |
| @@ -1477,7 +1478,6 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
| 1477 | * Clear any false indication of pending signals that might | 1478 | * Clear any false indication of pending signals that might |
| 1478 | * be seen by the filesystem code called to write the core file. | 1479 | * be seen by the filesystem code called to write the core file. |
| 1479 | */ | 1480 | */ |
| 1480 | current->signal->group_stop_count = 0; | ||
| 1481 | clear_thread_flag(TIF_SIGPENDING); | 1481 | clear_thread_flag(TIF_SIGPENDING); |
| 1482 | 1482 | ||
| 1483 | if (current->signal->rlim[RLIMIT_CORE].rlim_cur < binfmt->min_coredump) | 1483 | if (current->signal->rlim[RLIMIT_CORE].rlim_cur < binfmt->min_coredump) |
| @@ -1505,7 +1505,7 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
| 1505 | goto close_fail; | 1505 | goto close_fail; |
| 1506 | if (!file->f_op->write) | 1506 | if (!file->f_op->write) |
| 1507 | goto close_fail; | 1507 | goto close_fail; |
| 1508 | if (do_truncate(file->f_dentry, 0, file) != 0) | 1508 | if (do_truncate(file->f_dentry, 0, 0, file) != 0) |
| 1509 | goto close_fail; | 1509 | goto close_fail; |
| 1510 | 1510 | ||
| 1511 | retval = binfmt->core_dump(signr, regs, file); | 1511 | retval = binfmt->core_dump(signr, regs, file); |
