summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorManoj Prabhu B <bmanoj@codeaurora.org>2020-03-18 15:14:53 +0530
committerMichael Bestas <mkbestas@lineageos.org>2021-08-19 08:44:19 +0300
commitf8b7327527d30cf96ffabd8434248feb3762707a (patch)
tree7b57e59944fb9f05bfd0154b7fec7cd6c3b76030 /drivers/char
parentcf9acebb178f5fe66275e445708717c9c0559b93 (diff)
diag: Prevent resource leakage of task structure
The task structure with reference count incremented while dci client is registered should be updated with reference count decremented in failure case of registration. Change-Id: I093229d83dca2699e0343224756895eff0915e38 Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org> CVE-2020-11160
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/diag/diag_dci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/diag/diag_dci.c b/drivers/char/diag/diag_dci.c
index 1fe7fa0debcc..973bc3b1c5b5 100644
--- a/drivers/char/diag/diag_dci.c
+++ b/drivers/char/diag/diag_dci.c
@@ -3157,6 +3157,7 @@ fail_alloc:
kfree(new_entry);
new_entry = NULL;
}
+ put_task_struct(current);
mutex_unlock(&driver->dci_mutex);
return DIAG_DCI_NO_REG;
}