nuttx/fs
hujun5 90387a5b41 libc/misc: add fdsan module
FD (file descriptor) is widely used in system software development,
and almost all implementations of posix os (including nuttx) use FD as an index.
the value of fd needs to be allocated starting from the minimum available value of 3, and each process has a copy,
so the same fd value is very easy to reuse in the program.

In multi threaded or multi process environments without address isolation,
If the ownership, global variables, and competition relationships of fd are not properly handled,
there may be issues with fd duplication or accidental closure.
Further leading to the following issues, which are difficult to troubleshoot.

1. Security vulnerability: the fd we wrote is not the expected fd and will be accessed by hackers to obtain data
2. Program exceptions or crashes: write or read fd failures, and program logic errors
3. The structured file XML or database is damaged: the data format written to the database is not the expected format.

The implementation principle of fdsan is based on the implementation of Android
https://android.googlesource.com/platform/bionic/+/master/docs/fdsan.md

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-17 10:24:42 +08:00
..
aio sched/getpid: replace syscall getpid/tid/ppid() to kernel version 2023-02-02 10:33:01 +08:00
binfs fs/vfs: Add a new argument(size_t len) to inode_getpath 2023-05-08 09:57:01 +02:00
cromfs fs: Add g_ prefix for all global mountpt_operations instances 2023-04-24 16:13:29 +02:00
driver Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00
fat fs: Add g_ prefix for all global mountpt_operations instances 2023-04-24 16:13:29 +02:00
hostfs fs: Replace strncat with strlcat 2023-05-08 09:57:01 +02:00
inode libc/misc: add fdsan module 2023-05-17 10:24:42 +08:00
littlefs Add patch for littlefs to use kmm_malloc/free on kernel with MMU. 2023-04-28 16:45:05 +08:00
mmap mm/mm_map: Give the mm_map as parameter to the mm_map functions 2023-04-22 00:40:37 +08:00
mount Replace all sprintf with snprintf 2023-05-08 09:57:01 +02:00
mqueue fs/vfs: Zero file struct field with memset 2023-05-08 17:56:07 +03:00
nfs fs: Add g_ prefix for all global mountpt_operations instances 2023-04-24 16:13:29 +02:00
nxffs fs/nxffs/Kconfig: Fix indentation 2023-05-10 00:45:29 +08:00
partition nuttx: add more dependent header file 2023-04-11 09:13:32 +03:00
procfs fs: Add g_ prefix for all global mountpt_operations instances 2023-04-24 16:13:29 +02:00
romfs fs/vfs: Add a new argument(size_t len) to inode_getpath 2023-05-08 09:57:01 +02:00
rpmsgfs fs: Replace strncat with strlcat 2023-05-08 09:57:01 +02:00
semaphore sem_unlink: return ENOENT when the named semaphore does not exist. 2023-01-09 22:46:30 +08:00
shm fs/vfs: Zero file struct field with memset 2023-05-08 17:56:07 +03:00
smartfs fs: Add g_ prefix for all global mountpt_operations instances 2023-04-24 16:13:29 +02:00
socket vfs/fs_truncate.c:Add socket judgment to return correct errno. 2023-01-17 10:29:41 +08:00
spiffs fs: Add g_ prefix for all global mountpt_operations instances 2023-04-24 16:13:29 +02:00
tmpfs fs: Add g_ prefix for all global mountpt_operations instances 2023-04-24 16:13:29 +02:00
unionfs fs/vfs: Zero file struct field with memset 2023-05-08 17:56:07 +03:00
userfs fs: Add g_ prefix for all global mountpt_operations instances 2023-04-24 16:13:29 +02:00
vfs libc/misc: add fdsan module 2023-05-17 10:24:42 +08:00
fs_initialize.c fs: Flush the file system cache in BOARDIOC_POWEROFF too 2023-04-21 20:37:59 +03:00
Kconfig Remove the tail spaces from all files except Documentation 2023-02-26 13:24:24 -08:00
Makefile Minor style clean up 2023-01-28 19:53:20 +02:00