Defending Attacks Part 2: Kernel Exploit "DirtyCOW"
Some Background When code is executed in the kernel it has more capabilities than code executed in user mode. This includes access to kernel data structures, access to the virtual address space of any process, and many other privileged abilities. When code is written to "trick" the kernel to perform an unethical action (often leading to privilege escalation) this is called a kernel exploit . In this post we'll be examining a famous kernel exploit known as "Dirty COW" which applies a race condition to a memory mapped file allowing a non-privileged user to modify a file that should be read only to them. Important Concepts to Refresh Pages In operating systems memory is not handled in bytes at a time. Rather it is handled in the "unit of transfer" also known as pages. Pages are essentially "blocks of memory", typically 4KiB (4096 bytes) in size. Pages are used when referencing both virtual and physical memory. For this article, when talk...