KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
81 stars 5 forks source link

Add kvzalloc() and kvmalloc() functions to alloc-with-multiplies check in checkpatch.pl #187

Closed GustavoARSilva closed 2 years ago

GustavoARSilva commented 2 years ago

Update checkpatch.pl to check for instances of kvzalloc()/kvmalloc() that could be replaced with their 2-factor multiplication argument form kvcalloc()/kvmalloc_array(). So, they can be caught before new code is even committed.

Related to: https://github.com/KSPP/linux/issues/162

GustavoARSilva commented 2 years ago

In mainline now: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=73f1d07e5f8a1dec989a5ec964f5f2ce5b6f8825