3 ms·
I also glanced at the article, so I have a couple more details (and a small correction; the memory itself is not being truncated, the size of the memory region
by saagarjha 8y ago
I also glanced at the article, so I have a couple more details (and a small correction; the memory itself is not being truncated, the size of the memory region is):
1. Binder allows sharing memory between processes.
2. The shared memory data structure includes a 64-bit size.
3. 32-bit processes attempt to mmap this and end up converting the 64-bit uint64_t size to a 32-bit size_t and mapping in the wrong amount of data.
4. MediaCasService, a HAL module that has access to the TEE for what is essentially DRM purposes, performs bounds checks in 64-bit and doesn’t use the shared memory at all. Thus, it provides what’s essentially arbitrary read/write.
5. Leaking the location of the stack and where libc is allows for a ROP chain (which is necessary because marking memory as executable is not possible). The author uses this to cobble together a PoC that dumps the QSEOS version.