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
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
Manoj Prabhu B
2021-02-26 09:53:48 +01:00
committed by matteo0026
parent ce18281b0a
commit 73bb7ae2f8
+2 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -2201,6 +2201,7 @@ fail_alloc:
kfree(new_entry->dci_log_mask);
}
kfree(new_entry);
put_task_struct(current);
mutex_unlock(&driver->dci_mutex);
return DIAG_DCI_NO_REG;
}