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



Sign in to add a comment
MacOS: raw frame pointers in stackshot
Project Member Reported by jannh@google.com, Mar 3 2017 Back to list
This is an issue that allows unentitled root to read kernel frame
pointers, which might be useful in combination with a kernel memory
corruption bug.

By design, the syscall stack_snapshot_with_config() permits unentitled
root to dump information about all user stacks and kernel stacks.
While a target thread, along with the rest of the system, is frozen,
machine_trace_thread64() dumps its kernel stack.
machine_trace_thread64() walks up the kernel stack using the chain of
saved RBPs. It dumps the unslid kernel text pointers together with
unobfuscated frame pointers.

The attached PoC dumps a stackshot into the file stackshot_data.bin
when executed as root. The stackshot contains data like this:

00000a70  de 14 40 00 80 ff ff ff  a0 be 08 77 80 ff ff ff  |..@........w....|
00000a80  7b b8 30 00 80 ff ff ff  20 bf 08 77 80 ff ff ff  |{.0..... ..w....|
00000a90  9e a6 30 00 80 ff ff ff  60 bf 08 77 80 ff ff ff  |..0.....`..w....|
00000aa0  5d ac 33 00 80 ff ff ff  b0 bf 08 77 80 ff ff ff  |].3........w....|

The addresses on the left are unslid kernel text pointers; the
addresses on the right are valid kernel stack pointers.

This bug is subject to a 90 day disclosure deadline. After 90 days elapse
or a patch has been made broadly available, the bug report will become
visible to the public.

 
priv_kreg_leak.tar
20.0 KB Download
Project Member Comment 1 by jannh@google.com, Mar 3 2017
Labels: Id-660573370
Project Member Comment 2 by ianbeer@google.com, Mar 3 2017
Labels: -Finder-ianbeer
Project Member Comment 3 by jannh@google.com, May 11 2017
Apple says the fix will be released May 15th, 2017.
Project Member Comment 4 by jannh@google.com, May 17 2017
Labels: CVE-2017-2516
Status: Fixed
Fixed in MacOS 10.12.5: https://support.apple.com/en-us/HT207797
Project Member Comment 5 by jannh@google.com, May 21 2017
Labels: -Restrict-View-Commit
Project Member Comment 6 by jannh@google.com, Jun 2
Labels: Methodology-source-review
Sign in to add a comment