Open patacongo opened 4 years ago
Related to Issue #1359
For myself and others reference later there is some information on how the Linux kernel handles this here https://linux-kernel-labs.github.io/refs/pull/187/merge/lectures/syscalls.html#system-call-parameters-handling
Some notes on further hardened usercopy in Linux https://lwn.net/Articles/693745/
From freebsd the copyin copyout framework https://freebsdfoundation.org/wp-content/uploads/2021/07/The-copyinout-Framework.pdf
As a security measure, system calls such as read() or any other system call that modifies memory, must verify that the user-provided addresses lie in user-space. Otherwise, this opens a back door that may be exploited to take control of the OS or to crash the OS.
This applies only to PROTECTED and KERNEL build modes.