Many unchecked calls to kmalloc() in Linux 2.2.11

Christopher Peterson (cpeterso@cs.washington.edu)
Fri, 13 Aug 1999 13:46:26 -0700


Searching through the new Linux 2.2.11 source tree with a lint script, I
have found 166 possibly crash-worthy bugs. These are places where a
developer has called a function that can return NULL, but has forgotten to
check for a NULL return value. For example, many developers call kmalloc(),
__get_free_pages(), or ioremap() without checking for NULL, assuming these
functions will always succeed. Although these functions rarely return NULL,
this is still a real possibility for a heavily stressed Linux server. If we
want Linux to become even more reliable, we need to stamp out bugs in every
corner of the source code.

I don't have the copious free time necessary to track down the owners for
all 166 bugs, so I'm hoping the friendly, distributed Linux community can
help track down all the proper owners! I'll remove bugs from my posted bug
list when they are fixed in future Linux patches. Rather than flooding the
linux-kernel list with a huge email, I've posted the list of bugs at:

http://www.cs.washington.edu/homes/cpeterso/linuxbugs.txt

I posted a similar post a couple months ago for Linux 2.2.10. For
comparison, Linux 2.2.10 had 217 possible NULL bugs and Linux 2.2.11 now has
166. FreeBSD 3.1 had ZERO unchecked malloc() calls.

bon appetite!
:-D

chris

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/