Cook: security things in Linux v5.0

Post Syndicated from corbet original

Kees Cook reviews
some of the security-related enhancements
in the 5.0 kernel.
While the C language has a statement to indicate the end of a switch
case (‘break’), it doesn’t have a statement to indicate that execution
should fall through to the next case statement (just the lack of a ‘break’
is used to indicate it should fall through — but this is not always the
case), and such ‘implicit fall-through’ may lead to bugs. Gustavo Silva has
been the driving force behind fixing these since at least v4.14, with well
over 300 patches on the topic alone (and over 20 missing break statements
found and fixed as a result of the work). The goal is to be able to add
-Wimplicit-fallthrough to the build so that the kernel will stay entirely
free of this class of bug going forward. From roughly 2300 warnings, the
kernel is now down to about 200. It’s also worth noting that with Stephen
Rothwell’s help, this bug has been kept out of linux-next by him sending
warning emails to any tree maintainers where a new instance is introduced
(for example, here’s a bug introduced on Feb 20th and fixed on Feb