New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 5 users
Status: Fixed
Owner:
Email to this user bounced
Closed: Sep 2014



Sign in to add a comment
OS X IOKit kernel code execution due to lack of bounds checking in GPU command buffers
Project Member Reported by ianbeer@google.com, Jun 6 2014 Back to list
The Intel GPU driver uses shared memory for drawing commands. The userspace
client of the driver calls IOConnectMapMemory to map a shared page which it will use,
calling selector 2 of the IOAccelerator userclient (submit_data_buffers) to signal to the driver that it should
consume the commands (tokens) written there by the client.

The first 0x10 bytes of the shared memory are some kind of header, the rest is filled with
tokens of the form:

+0x00 2-byte token ID
+0x02 length of token (in 4 byte words, including this header)
+0x04 4 byte output offset??
+0x08 body of token
..

I'm still not completely sure what the 4 byte output offset field is actually for,
but after processing all the tokens the driver calls IGAccelFIFOChannel::submitBuffer,
and writes two words (maybe end of buffer delimiters?) using a value derived from those offset fields
as an index and there's no bounds checking, so by specifying a large output offset for a token
you can get this function to write the two words: 0x05000000 0x00000000 at a controlled offset.

tested on: MacBookAir5,2 w/ 10.9.3/13d64

(it appears to crash the GeForce driver too with what looks at first glance like a similar issue. I haven't had a chance to look at it yet but running this repro on a MacBookPro10,1 crashes in nvFermiGLContext::UpdateDrawableOffsets with an OOB write)
 
ig_sideband_buffer_oob.c
3.7 KB Download
Project Member Comment 1 by ianbeer@google.com, Jun 6 2014
Labels: Reported-2014-June-06
Project Member Comment 2 by ianbeer@google.com, Jun 6 2014
Labels: Id-606875918
Project Member Comment 3 by ianbeer@google.com, Aug 22 2014
Labels: Deadline-90
Project Member Comment 4 by ianbeer@google.com, Sep 5 2014
Labels: -Restrict-View-Commit Deadline-Exceeded
Deadline exceeded - automatically derestricting
Project Member Comment 5 by ianbeer@google.com, Sep 8 2014
Labels: PublicOn-2014-September-04
Comment 6 by cevans@google.com, Sep 23 2014
Labels: -Reported-2014-June-06 -PublicOn-2014-September-04 Reported-2014-Jun-06 PublicOn-2014-Sep-04 CVE-2014-4394 Fixed-2014-Sep-17
Status: Fixed
Sign in to add a comment