CVE-2017-11176: A step-by-step Linux Kernel exploitation
A reference-counting flaw in the mq_notify path of the Linux kernel causes a double sock_put() on a netlink socket, freeing a socket that is still in use. An attacker with local access could turn this use-after-free into an arbitrary call primitive and ultimately execute code in kernel mode.
blog.lexfo.fr
Published on blog.lexfo.fr
This series covers a step-by-step walkthrough to develop a Linux kernel exploit from a CVE description. It starts with the patch analysis to understand the bug and trigger it from kernel land (part 1), then it gradually builds a working proof-of-concept code (part 2).
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
A local attacker could exploit the use-after-free to gain an arbitrary call primitive and execute code in ring-0, though the exploit is not targetless and needs offsets and gadgets adjusted per target.
What the attacker needed
Local access to the target; kernel below 4.11.9; amd64 architecture; SMEP enabled, kASLR and SMAP disabled
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The kernel keeps a count of how many things are using each object, and it frees the object when the count reaches zero. Here the code decremented that count twice for the same socket, so the kernel freed a socket that was still being used. A local attacker could then reuse that freed memory to take control of the kernel.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.