nuttx/fs/vfs
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
..
fs_chstat.c Fix various typos 2022-07-08 02:15:54 +08:00
fs_close.c fs/vfs: Zero file struct field with memset 2023-05-08 17:56:07 +03:00
fs_dir.c fs/vfs: Zero file struct field with memset 2023-05-08 17:56:07 +03:00
fs_dup2.c fs/vfs: Zero file struct field with memset 2023-05-08 17:56:07 +03:00
fs_dup.c vfs: Suppoprt F_DUPFD_CLOEXEC and MSG_CMSG_CLOEXEC 2023-02-02 01:00:10 +02:00
fs_epoll.c fs/fs_epoll: add oneshot list to handle the EPOLLONESHOT correctly 2023-03-23 09:43:27 +02:00
fs_eventfd.c fs: Move mmap callback before truncate in [file|mountpt]_operations 2023-01-04 17:43:59 +02:00
fs_fchstat.c Fix various typos 2022-07-08 02:15:54 +08:00
fs_fcntl.c vfs: Suppoprt F_DUPFD_CLOEXEC and MSG_CMSG_CLOEXEC 2023-02-02 01:00:10 +02:00
fs_fdopen.c fs/streams: Move the file streams from the group structure into TLS 2022-12-22 20:16:11 +08:00
fs_fstat.c fs/inode: add sanity check for inode to avoid nullpointer 2021-07-25 23:01:37 -07:00
fs_fstatfs.c Don't include assert.h from public header file 2021-06-03 08:36:03 -07:00
fs_fsync.c fs: Don't guard fsync with CONFIG_DISABLE_MOUNTPOINT 2023-02-14 11:24:37 +08:00
fs_ioctl.c libc/misc: add fdsan module 2023-05-17 10:24:42 +08:00
fs_link.c fs: Implment link as a normal function instead macro 2023-02-04 18:31:23 -03:00
fs_lseek.c lseek: use type:off_t for return value 2022-03-28 22:49:37 +08:00
fs_mkdir.c Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00
fs_open.c fs/vfs: Zero file struct field with memset 2023-05-08 17:56:07 +03:00
fs_poll.c vfs/poll: Remove POLLFILE and POLLSOCK NuttX specific extension 2023-01-17 14:02:59 +08:00
fs_pread.c
fs_pwrite.c
fs_read.c Don't include assert.h from public header file 2021-06-03 08:36:03 -07:00
fs_readlink.c nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
fs_rename.c Fixes in asprintf usage. 2023-04-19 02:48:39 +08:00
fs_rmdir.c Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00
fs_select.c fs: Remove the unused nx_poll to prefer file_poll for kernel 2022-10-27 23:14:25 +02:00
fs_sendfile.c fs: Simplify sendfile implementation 2021-07-17 07:39:15 -03:00
fs_signalfd.c fs: Move mmap callback before truncate in [file|mountpt]_operations 2023-01-04 17:43:59 +02:00
fs_stat.c sched/mqueue: make mqueue and mqueue sysv can disable separately 2022-11-16 20:03:40 +08:00
fs_statfs.c fs/vfs: Add file descriptor based timers support 2021-12-20 04:00:20 -06:00
fs_symlink.c Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00
fs_timerfd.c fs/timerfd: Reverse truncate and mmap field 2023-01-07 14:27:42 +02:00
fs_truncate.c fs: Don't guard ftruncate with CONFIG_DISABLE_MOUNTPOINT 2023-02-14 11:24:37 +08:00
fs_unlink.c Replace nxsem API when used as a lock with nxmutex API 2022-10-17 15:59:46 +09:00
fs_write.c vfs: adjust the error code of write to be consistent with read 2021-04-08 21:52:14 -05:00
Kconfig fs/signalfd: using file descriptor to accept signal 2022-12-28 23:05:58 +08:00
Make.defs fs: Don't guard ftruncate with CONFIG_DISABLE_MOUNTPOINT 2023-02-14 11:24:37 +08:00