diff mbox

[10/11] LSM: Complete task_alloc hook

Message ID 31d9d21d-8261-a061-a010-d5fb4b3e341e@schaufler-ca.com (mailing list archive)
State New, archived
Headers show

Commit Message

Casey Schaufler Aug. 29, 2017, 9:03 p.m. UTC
Subject: [PATCH 10/11] LSM: Complete task_alloc hook

The Task alloc hook needs to allocate the data.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
---
 security/security.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/security/security.c b/security/security.c
index 6ebcc89004ef..a66663ac932b 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1387,6 +1387,10 @@  int security_file_open(struct file *file, const struct cred *cred)
 
 int security_task_alloc(struct task_struct *task, unsigned long clone_flags)
 {
+	int rc = lsm_task_alloc(task);
+
+	if (rc)
+		return rc;
 	return call_int_hook(task_alloc, 0, task, clone_flags);
 }