Over at the Project Zero blog, Jann Horn has a lengthy post on a kernel bug, ways to exploit it, and various ideas on mitigation. While the exploitation analysis is highly detailed, more than half of the post looks at various defenses to this kind of bug.
This blog post describes a straightforward Linux kernel locking bug and how I exploited it against Debian Buster’s 4.19.0-13-amd64 kernel. Based on that, it explores options for security mitigations that could prevent or hinder exploitation of issues similar to this one.
I hope that stepping through such an exploit and sharing this compiled knowledge with the wider security community can help with reasoning about the relative utility of various mitigation approaches.
A lot of the individual exploitation techniques and mitigation options that I am describing here aren’t novel. However, I believe that there is value in writing them up together to show how various mitigations interact with a fairly normal use-after-free exploit.