The Linux kernel has memory management (mm) related bugs over the years. One of the most well-known is the Dirty COW. Since then, researchers have found similar bugs rooted in the same issue, popping up in areas like huge pages and shared memory. Even though the mm subsystem has gone through a lot of changes and improvements over time, revisiting these classic bugs is still very useful. In this post, I’ll walk through the root cause of Dirty COW and share my thought process while digging into it.