IOHDXIControllerUserClient stores a task struct pointer (passed in via IOServiceOpen) in the field at +0x1f8 without taking a reference.
By killing the corrisponding task we can free this pointer leaving the user client with a dangling pointer. We can get this pointer used
by calling the CreateDrive64 external method which will try to read and use the memory map off of the free'd task struct.
This bug could be leveraged for kernel memory corruption.
build: clang -o iohdix_task_uaf iohdix_task_uaf.c -framework IOKit
You should set gzalloc_min=1024 gzalloc_max=2048 or similar to actually fault on the UaF - otherwise you might see some weird panics!
tested on OS X 10.11.5 (15F34) on MacBookAir5,2