Merge "msm:adsprpc: Prevent use after free in fastrpc_set_process_info"

This commit is contained in:
qctecmdr 2020-08-13 04:49:34 -07:00 • committed by Gerrit - the friendly Code Review server
commit b0b7e93f35

View file

@ -5184,7 +5184,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;