Resources

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!

GhostLock, a stack-UAF that has existed in ALL Linux distributions for 15 years - 2239

Nebula SecurityPosted 27 Days Ago
  • The Linux OS is absolutely everything, and is a thoroughly reviewed codebase. This blog post dives into a privilege escalation that they found in the kernel. This article is a lot of AI slop but there's still some interesting takeaways from it.
  • The helper function remove_waiter() was written for a single scenario: a thread that blocks on its own, then cleans up after itself. To do this, it's always assumed that the current is the thread that needs to be cleaned up, and clears current->pi_blocked_on.
  • The Requeue-PI broke this assumption. In rt_mutex_start_proxy_lock(), the helper is used to clean up on behalf of a different, sleeping thread. Current is the thread that was issued, rather than the actual waiting thread. When there's a potential deadlock, the code rolls back via remove_waiter(). This leads to the function removing the wrong task!
  • They found a way to trigger a deadlock for this bug to happen. Because the task is cleared, it leaves the waiter task in userspace dangling on a closed frame: a stack UAF has been created.
  • I'm not super into Linux kernel exploitation. But, the rest of the article is super AI-sloppy, and I don't really understand it. So, I'm just going to skip it. It seems like they got a privilege escalation in the Linux kernel via this bug.