New issue
Advanced search Search tips
Starred by 2 users
Status: Fixed
Owner:
Closed: Jul 2015
Cc:



Sign in to add a comment
OS X IOKit kernel code execution due to use of IOAccelSurface2::convertGLIndexToBufferIndex error code return value as buffer index
Project Member Reported by ianbeer@google.com, Apr 17 2015 Back to list
The function IOAccelSurface2::convertGLIndexToBufferIndex converts an eIOAccelGLBufferType enum value to a surface buffer index.
If convertGLIndexToBufferIndex is passed an invalid enum value it returns 0xffff, however no call sites actually check the return value and blindly pass it to IGAccelGLContext::getSurfaceBuffer which will use the index to read an object pointer out-of-bounds and then call a virtual function.

This PoC modifies the BindDepthBuffer token to overwrite the value at offset +8 which is passed to convertGLIndexToBufferIndex.

It may be necessary to run the PoC a few times to hit the crash, since if the OOB value is NULL or the field at +40 of the read pointer is NULL then this will just hit an error path and not crash.

tested on: MacBookAir5,2 w/ 10.10.3 (14D131)
build: clang -Wall -dynamiclib -o ig_convertGLIndex.dylib ig_convertGLIndex.c -framework IOKit -arch i386 -arch x86_64
run: DYLD_INSERT_LIBRARIES=./ig_convertGLIndex.dylib /Applications/Chess.app/Contents/MacOS/Chess
note: because of the nature of the heap oob read you may have to run the repro a few times to hit a bad value
 
ig_convertGLIndex.c
7.9 KB Download
Project Member Comment 1 by ianbeer@google.com, Apr 17 2015
Labels: Reported-2015-Apr-17 Id-621705895
Project Member Comment 2 by ianbeer@google.com, Apr 17 2015
Owner: ianbeer@google.com
Project Member Comment 3 by ianbeer@google.com, Jul 20 2015
Labels: CVE-2015-3701 Fixed-2015-Jun-30
Status: Fixed
https://support.apple.com/en-us/HT204942
Project Member Comment 4 by ianbeer@google.com, Jul 31 2015
Labels: -Restrict-View-Commit
Sign in to add a comment