msm:ipa: Fix to kasan use-after-free issue

Added mutex lock to query rt table function also to sync
with other ioctl calls in ipa.
Change-Id: I65d46c0ef28b5e6260c92473fd15e9763de20146
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
This commit is contained in:
Mohammed Javid 2017-06-25 01:01:55 +05:30 committed by Gerrit - the friendly Code Review server
parent befd353b41
commit 10a74f4b41
1 changed files with 5 additions and 1 deletions

View File

@ -828,12 +828,16 @@ int ipa_query_rt_index(struct ipa_ioc_get_rt_tbl_indx *in)
return -EINVAL;
}
mutex_lock(&ipa_ctx->lock);
/* check if this table exists */
entry = __ipa_find_rt_tbl(in->ip, in->name);
if (!entry)
if (!entry){
mutex_unlock(&ipa_ctx->lock);
return -EFAULT;
}
in->idx = entry->idx;
mutex_unlock(&ipa_ctx->lock);
return 0;
}