People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!
IORING_OP_CLOSE operation, the system call passes a files_struct to the kernel thread. However, the pointer does not increment the reference count! This creates a discrepancy between the amount of expected places using this pointer and the actual amount. This creates a use after free (UAF) vulnerability. files_struct to get a reference. Then, concurrently, get the IORING_OP_CLOSE to quickly run and free the object. Now, the other location has a UAF on the object.map_lookup_elem and map_update_elem respectively. This functionality can be used to free the file object, insert our user controlled data with pointers into this location then the copy_to_user() function is called, allowing for an arbitrary read primitive. map_update_elem function with the data being written coming from userland. This exploit method is restricted to a one-core env because of the code being hit though. recvmsg in the kernel to block on a specific operation, the race window becomes more consistent to win.