tee: shm: fix shm leak in register_shm_helper()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tee: shm: fix shm leak in register_shm_helper()
register_shm_helper() allocates shm before calling iov_iter_npages(). If iov_iter_npages() returns 0, the function jumps to err_ctx_put and leaks shm.
This can be triggered by TEE_IOC_SHM_REGISTER with struct tee_ioctl_shm_register_data where length is 0.
Jump to err_free_shm instead.
From the CVE record · Linux
The Linux kernel's register_shm_helper() leaks allocated shared memory when iov_iter_npages() returns 0. A local caller can trigger this by using TEE_IOC_SHM_REGISTER with a length of 0; the input does not specify any authentication requirement.
Anyone running a Linux kernel with the affected TEE shared memory registration code should check their version; affected versions were not provided.