A vulnerability in an operating system kernel is a security nightmare. This article analyzes some well known kernel security problems, explains how they are exploited, and gives real-life examples of attacks that used these time-honored techniques.
Some security issues remind me of Groundhog Day – they just keep coming back. One example of a problem that won’t go away is buffer overflow, which was first described in 1972 , got a fair bit of attention in 1996 in the oft-quoted Phrack e-zine article “Smashing the Stack for Fun and Profit” , and is still one of the most prevalent programming mistakes that can lead to a code injection. And it isn’t due to the lack of media coverage that integer overflows are still around – long after they caused the Ariane 5 rocket explosion  and the massive Stagefright security issue in Android. The fact is that many of the same few problems continue to turn up, and most could have been prevented by code analysis  and defensive programming.
This article takes a close look at some of the techniques attackers use to crack the Linux kernel.
Stein and Shot
You can perform a simple test at home for a graphic example of a buffer overflow: Grab a shot glass and a comfortably sized Munich beer stein, fill the stein to the top, then pour all of its contents into the shot glass. Take note of the overflow. To prevent this situation, the bartender must compare the source’s size to the size of the destination buffer.
Use Express-Checkout link below to read the full article (PDF).