Welcome & Opening Remarks- James Morris & Meaningful Bounds Checking in the Linux Kernel- Kees Cook
Channel: The Linux Foundation
Date: 2022-08-08

Welcome & Opening Remarks - James Morris & Meaningful Bounds Checking in the Linux Kernel - Kees Cook, Google

Welcome to LSS NA 2022! 

Like all C code, the Linux Kernel regularly suffers from buffer overflow flaws. While stack overflows have been largely addressed, heap overflows remain common. Especially frustrating is that the compiler usually has enough context to have been able to stop the overflow but C APIs are so terrible that it doesn't happen. We'll take a quick look through the last 3 years of heap buffer overflow CVEs in the kernel, which shows that all 11 memcpy overflows from this timespan (which includes the BleedingTooth exploit), could have been detected and mitigated by the compiler. The limitations of C language standards, APIs, kernel coding conventions, and compiler bugs make this a difficult problem. We will explore the path to solutions being developed in the Linux kernel for dealing with array index overflows, string manipulation overflows, and especially memcpy overflows. We will cover the history of C flexible arrays, the unexpected places where the "-Warray-bounds" and "-fsanitize=bounds" compiler options don't work, the limits of "__builtin_object_size" (the work-horse of FORTIFY_SOURCE), and how memcpy is being effectively replaced to stop overflows from ever happening again.