summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2016-12-05 20:07:20 -0800
committerSvetoslav Ganov <svetoslavganov@google.com>2016-12-07 22:43:56 +0000
commit74c9983e80d8224bbe1de7c37e8f6ac4a76df11d (patch)
tree1c8681cfc6e4844c19211655ad86919f2aa5c58c /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parent713f913c4445f754f26b812ce8231ec36f806373 (diff)
Fix vulnerability in MemoryIntArray
MemoryIntArray was using the size of the undelying ashmem region to mmap the data but the ashmem size can be changed until the former is memory mapped. Since we use the ashmem region size for boundary checking and memory unmapping if it does not match the size used while mapping an attacker can force the system to unmap memory or to access undefined memory and crash. Also we were passing the memory address where the ashmem region is mapped in the owner process to support cases where the client can pass back the MemoryIntArray instance. This allows an attacker to put invalid address and cause arbitrary memory to be freed. Now we no longer support passing back the instance to the owner process (the passed back instance is read only), so no need to pass the memory adress of the owner's mapping, thus not allowing freeing arbitrary memory. Further, we now check the memory mapped size against the size of the underlying ashmem region after we do the memory mapping (to fix the ahsmem size) and if an attacker changed the size under us we throw. Tests: Updated the tests and they pass. bug:33039926 bug:33042690 Change-Id: Ib8e50afcdb5475123968572ac9696e8ed4031631
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions