nuttx-update/fs/socket
George Poulios 884b4604c2 Map user memory passed to accept() in kernel build
Fixes an issue in kernel build where the user addresses passed
to accept() would be accessed when the wrong MMU mappings were
active. A crash would manifest when attempting to accept() on a
TCP server socket for instance under significant load. The accept
event handler would be called by the HP worker upon client
connection. At this point, accept_tcpsender() would attempt to
write to `addr` resulting in a page fault. Reproducibility would
depend on the current system load (num tasks or CPU stress) but
in loaded environments, it would crash almost 100% of the times.

It should be noted that Linux does this the other way around: it
operates on kernel stack allocated data and once done, it copies
them to user. This can also be a viable alternative, albeit with
one extra copy and a little extra memory.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2024-12-20 00:57:40 +02:00
..
accept.c Map user memory passed to accept() in kernel build 2024-12-20 00:57:40 +02:00
CMakeLists.txt fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
Make.defs fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
socket.c fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
socketpair.c fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00