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

Reevaluate "only check dynamic sizes" optimization for hardened usercopy #171

Open kees opened 2 years ago

kees commented 2 years ago

There is an optimization with the hardened usercopy object size checker to only do the checking when the copy size is runtime dynamic: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/thread_info.h?h=v5.17#n198

Can this be adjusted to catch const size mistakes? Perhaps require that the buffer also be statically sized?

https://twitter.com/kees_cook/status/1460888738452545536