apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.81k stars 1.16k forks source link

System calls require address checks #1329

Open patacongo opened 4 years ago

patacongo commented 4 years ago

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.

patacongo commented 4 years ago

Related to Issue #1359

btashton commented 1 year ago

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