Android: mitigation bypass - the guard page creation in IOMX can fail
CVE-2016-6717
Because of a design bug in IOMX, the user-supplied sizes in the GET_PARAMETER and SET_PARAMETER calls are discarded before calling in to the responsible OMX code-paths (see OMXNodeInstance.{get,set}Parameter).
This has led to a variety of overflow-type bugs, including <a href="https://code.google.com/p/android/issues/detail?id=200821" title="" class="" rel="nofollow">https://code.google.com/p/android/issues/detail?id=200821</a>.
In order to mitigate these overflows, the buffers allocated for the user are extended by a single page, and that page is made inaccessible by calling:
mprotect((char*)params + allocSize - pageSize, pageSize, PROT_NONE);
(see <a href="http://androidxref.com/7.0.0_r1/xref/frameworks/av/media/libmedia/IOMX.cpp#778" title="" class="" rel="nofollow">http://androidxref.com/7.0.0_r1/xref/frameworks/av/media/libmedia/IOMX.cpp#778</a>)
However, the return value of mprotect here is not checked and the mprotect request may fail in extreme cases (for example, if the kernel is running low on memory).
If an attacker manages to cause this condition to occur, the trailing page will remain RW, which could re-introduce the old GET_PARAMETER/SET_PARAMETER bugs (allowing the attacker to overflow into potentially sensitive data).
This bug is subject to a 90 day disclosure deadline. If 90 days elapse
without a broadly available patch, then the bug report will automatically
become visible to the public.
Found by: laginimaineb