mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
msm:adsprpc: Prevent use after free in fastrpc_set_process_info
Serialize kzalloc in fastrpc_set_process_info and prevent use after free. Change-Id: I02d62182a234ef40ce33165247fc578f6727d27a Signed-off-by: Anirudh Raghavendra <araghave@codeaurora.org>
This commit is contained in:
parent
4027c201fd
commit
54b949b8f9
1 changed files with 8 additions and 0 deletions
|
|
@ -5119,7 +5119,15 @@ static int fastrpc_set_process_info(struct fastrpc_file *fl)
|
|||
if (debugfs_root) {
|
||||
buf_size = strlen(current->comm) + strlen("_")
|
||||
+ strlen(strpid) + 1;
|
||||
|
||||
spin_lock(&fl->hlock);
|
||||
if (fl->debug_buf) {
|
||||
spin_unlock(&fl->hlock);
|
||||
return err;
|
||||
}
|
||||
fl->debug_buf = kzalloc(buf_size, GFP_KERNEL);
|
||||
spin_unlock(&fl->hlock);
|
||||
|
||||
if (!fl->debug_buf) {
|
||||
err = -ENOMEM;
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue