]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/fork.c
[PATCH] unshare: Use rcu_assign_pointer when setting sighand
[linux-2.6-omap-h63xx.git] / kernel / fork.c
index a8eab86de7f103123158f2de62481e67366a57b0..46060cb24af0e06a7c21fdb67978f33644abbc3d 100644 (file)
@@ -1061,6 +1061,12 @@ static task_t *copy_process(unsigned long clone_flags,
         */
        p->clear_child_tid = (clone_flags & CLONE_CHILD_CLEARTID) ? child_tidptr: NULL;
 
+       /*
+        * sigaltstack should be cleared when sharing the same VM
+        */
+       if ((clone_flags & (CLONE_VM|CLONE_VFORK)) == CLONE_VM)
+               p->sas_ss_sp = p->sas_ss_size = 0;
+
        /*
         * Syscall tracing should be turned off in the child regardless
         * of CLONE_PTRACE.
@@ -1563,7 +1569,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags)
 
                if (new_sigh) {
                        sigh = current->sighand;
-                       current->sighand = new_sigh;
+                       rcu_assign_pointer(current->sighand, new_sigh);
                        new_sigh = sigh;
                }