mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
qcedev: fix UAF in qcedev_smmu
External researcher found UAF in qcedev_smmu.c on an error condition in qcedev_check_and_map_buffer. When an error occurs, we free binfo, but it is still kept in the registeredbufs list. The fix removes it from the list before freeing binfo. Change-Id: I0327e456bd46106b12c36a5a21305407aae428dd Signed-off-by: Daniel Perez-Zoghbi <quic_dperezzo@quicinc.com>
This commit is contained in:
parent
8375c081bb
commit
ed97e9cf1d
1 changed files with 5 additions and 1 deletions
|
|
@ -350,8 +350,12 @@ int qcedev_check_and_map_buffer(void *handle,
|
|||
return 0;
|
||||
|
||||
unmap:
|
||||
if (!found)
|
||||
if (!found) {
|
||||
qcedev_unmap_buffer(handle, mem_client, binfo);
|
||||
mutex_lock(&qce_hndl->registeredbufs.lock);
|
||||
list_del(&binfo->list);
|
||||
mutex_unlock(&qce_hndl->registeredbufs.lock);
|
||||
}
|
||||
|
||||
error:
|
||||
kfree(binfo);
|
||||
|
|
|
|||
Loading…
Reference in a new issue