diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2018-06-22 21:20:35 +0200 | 
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2018-06-22 21:20:35 +0200 | 
| commit | 7731b8bc94e599c9a79e428f3359ff2c34b7576a (patch) | |
| tree | 879f18ccbe274122f2d4f095b43cbc7f953e0ada /kernel/fork.c | |
| parent | 48e315618dc4dc8904182cd221e3d395d5d97005 (diff) | |
| parent | 9ffc59d57228d74809700be6f7ecb1db10292f05 (diff) | |
Merge branch 'linus' into x86/urgent
Required to queue a dependent fix.
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 15 | 
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index a5d21c42acfc..9440d61b925c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -440,6 +440,14 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,  			continue;  		}  		charge = 0; +		/* +		 * Don't duplicate many vmas if we've been oom-killed (for +		 * example) +		 */ +		if (fatal_signal_pending(current)) { +			retval = -EINTR; +			goto out; +		}  		if (mpnt->vm_flags & VM_ACCOUNT) {  			unsigned long len = vma_pages(mpnt); @@ -811,7 +819,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)  	clear_tsk_need_resched(tsk);  	set_task_stack_end_magic(tsk); -#ifdef CONFIG_CC_STACKPROTECTOR +#ifdef CONFIG_STACKPROTECTOR  	tsk->stack_canary = get_random_canary();  #endif @@ -899,6 +907,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,  	mm->pinned_vm = 0;  	memset(&mm->rss_stat, 0, sizeof(mm->rss_stat));  	spin_lock_init(&mm->page_table_lock); +	spin_lock_init(&mm->arg_lock);  	mm_init_cpumask(mm);  	mm_init_aio(mm);  	mm_init_owner(mm, p); @@ -1712,7 +1721,7 @@ static __latent_entropy struct task_struct *copy_process(  	p->start_time = ktime_get_ns();  	p->real_start_time = ktime_get_boot_ns();  	p->io_context = NULL; -	p->audit_context = NULL; +	audit_set_context(p, NULL);  	cgroup_fork(p);  #ifdef CONFIG_NUMA  	p->mempolicy = mpol_dup(p->mempolicy); @@ -1899,6 +1908,8 @@ static __latent_entropy struct task_struct *copy_process(  	 */  	copy_seccomp(p); +	rseq_fork(p, clone_flags); +  	/*  	 * Process group and session signals need to be delivered to just the  	 * parent before the fork or both the parent and the child after the  | 
