aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 7f2e31ba33af..f387a1393ca5 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1544,15 +1544,13 @@ static int unshare_namespace(unsigned long unshare_flags, struct namespace **new
1544} 1544}
1545 1545
1546/* 1546/*
1547 * Unsharing of sighand for tasks created with CLONE_SIGHAND is not 1547 * Unsharing of sighand is not supported yet
1548 * supported yet
1549 */ 1548 */
1550static int unshare_sighand(unsigned long unshare_flags, struct sighand_struct **new_sighp) 1549static int unshare_sighand(unsigned long unshare_flags, struct sighand_struct **new_sighp)
1551{ 1550{
1552 struct sighand_struct *sigh = current->sighand; 1551 struct sighand_struct *sigh = current->sighand;
1553 1552
1554 if ((unshare_flags & CLONE_SIGHAND) && 1553 if ((unshare_flags & CLONE_SIGHAND) && atomic_read(&sigh->count) > 1)
1555 (sigh && atomic_read(&sigh->count) > 1))
1556 return -EINVAL; 1554 return -EINVAL;
1557 else 1555 else
1558 return 0; 1556 return 0;
@@ -1626,7 +1624,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags)
1626 int err = 0; 1624 int err = 0;
1627 struct fs_struct *fs, *new_fs = NULL; 1625 struct fs_struct *fs, *new_fs = NULL;
1628 struct namespace *ns, *new_ns = NULL; 1626 struct namespace *ns, *new_ns = NULL;
1629 struct sighand_struct *sigh, *new_sigh = NULL; 1627 struct sighand_struct *new_sigh = NULL;
1630 struct mm_struct *mm, *new_mm = NULL, *active_mm = NULL; 1628 struct mm_struct *mm, *new_mm = NULL, *active_mm = NULL;
1631 struct files_struct *fd, *new_fd = NULL; 1629 struct files_struct *fd, *new_fd = NULL;
1632 struct sem_undo_list *new_ulist = NULL; 1630 struct sem_undo_list *new_ulist = NULL;
@@ -1671,7 +1669,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags)
1671 } 1669 }
1672 } 1670 }
1673 1671
1674 if (new_fs || new_ns || new_sigh || new_mm || new_fd || new_ulist || 1672 if (new_fs || new_ns || new_mm || new_fd || new_ulist ||
1675 new_uts || new_ipc) { 1673 new_uts || new_ipc) {
1676 1674
1677 task_lock(current); 1675 task_lock(current);
@@ -1693,12 +1691,6 @@ asmlinkage long sys_unshare(unsigned long unshare_flags)
1693 new_ns = ns; 1691 new_ns = ns;
1694 } 1692 }
1695 1693
1696 if (new_sigh) {
1697 sigh = current->sighand;
1698 rcu_assign_pointer(current->sighand, new_sigh);
1699 new_sigh = sigh;
1700 }
1701
1702 if (new_mm) { 1694 if (new_mm) {
1703 mm = current->mm; 1695 mm = current->mm;
1704 active_mm = current->active_mm; 1696 active_mm = current->active_mm;