summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/sched.h3
-rw-r--r--kernel/fork.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 774cb435c7d8..3de5aa210feb 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1044,8 +1044,9 @@ struct task_struct {
int (*notifier)(void *priv);
void *notifier_data;
sigset_t *notifier_mask;
-
+#ifdef CONFIG_SECURITY
void *security;
+#endif
struct audit_context *audit_context;
seccomp_t seccomp;
diff --git a/kernel/fork.c b/kernel/fork.c
index 3e764f6f2be1..490495a39c7e 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1079,7 +1079,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
do_posix_clock_monotonic_gettime(&p->start_time);
p->real_start_time = p->start_time;
monotonic_to_bootbased(&p->real_start_time);
+#ifdef CONFIG_SECURITY
p->security = NULL;
+#endif
p->io_context = NULL;
p->io_wait = NULL;
p->audit_context = NULL;