diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index da3a155bba0d..7c5c5888e00a 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/delayacct.h> | 49 | #include <linux/delayacct.h> |
50 | #include <linux/taskstats_kern.h> | 50 | #include <linux/taskstats_kern.h> |
51 | #include <linux/random.h> | 51 | #include <linux/random.h> |
52 | #include <linux/tty.h> | ||
52 | 53 | ||
53 | #include <asm/pgtable.h> | 54 | #include <asm/pgtable.h> |
54 | #include <asm/pgalloc.h> | 55 | #include <asm/pgalloc.h> |
@@ -897,6 +898,8 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts | |||
897 | } | 898 | } |
898 | acct_init_pacct(&sig->pacct); | 899 | acct_init_pacct(&sig->pacct); |
899 | 900 | ||
901 | tty_audit_fork(sig); | ||
902 | |||
900 | return 0; | 903 | return 0; |
901 | } | 904 | } |
902 | 905 | ||
@@ -999,7 +1002,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
999 | if (atomic_read(&p->user->processes) >= | 1002 | if (atomic_read(&p->user->processes) >= |
1000 | p->signal->rlim[RLIMIT_NPROC].rlim_cur) { | 1003 | p->signal->rlim[RLIMIT_NPROC].rlim_cur) { |
1001 | if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) && | 1004 | if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) && |
1002 | p->user != &root_user) | 1005 | p->user != current->nsproxy->user_ns->root_user) |
1003 | goto bad_fork_free; | 1006 | goto bad_fork_free; |
1004 | } | 1007 | } |
1005 | 1008 | ||
@@ -1059,6 +1062,8 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1059 | 1062 | ||
1060 | p->lock_depth = -1; /* -1 = no lock */ | 1063 | p->lock_depth = -1; /* -1 = no lock */ |
1061 | do_posix_clock_monotonic_gettime(&p->start_time); | 1064 | do_posix_clock_monotonic_gettime(&p->start_time); |
1065 | p->real_start_time = p->start_time; | ||
1066 | monotonic_to_bootbased(&p->real_start_time); | ||
1062 | p->security = NULL; | 1067 | p->security = NULL; |
1063 | p->io_context = NULL; | 1068 | p->io_context = NULL; |
1064 | p->io_wait = NULL; | 1069 | p->io_wait = NULL; |
@@ -1601,7 +1606,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags) | |||
1601 | err = -EINVAL; | 1606 | err = -EINVAL; |
1602 | if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND| | 1607 | if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND| |
1603 | CLONE_VM|CLONE_FILES|CLONE_SYSVSEM| | 1608 | CLONE_VM|CLONE_FILES|CLONE_SYSVSEM| |
1604 | CLONE_NEWUTS|CLONE_NEWIPC)) | 1609 | CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER)) |
1605 | goto bad_unshare_out; | 1610 | goto bad_unshare_out; |
1606 | 1611 | ||
1607 | if ((err = unshare_thread(unshare_flags))) | 1612 | if ((err = unshare_thread(unshare_flags))) |