walnux/libs/libc/misc
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
..
Kconfig libc/misc: add fdsan module 2023-05-17 10:24:42 +08:00
lib_crc8.c libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx 2022-08-13 13:28:24 +03:00
lib_crc8ccitt.c libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx 2022-08-13 13:28:24 +03:00
lib_crc8table.c libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx 2022-08-13 13:28:24 +03:00
lib_crc16.c libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx 2022-08-13 13:28:24 +03:00
lib_crc16ccitt.c arm64/a64: Add driver for MIPI DSI 2022-12-14 22:37:32 +08:00
lib_crc32.c libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx 2022-08-13 13:28:24 +03:00
lib_crc64.c libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx 2022-08-13 13:28:24 +03:00
lib_cxx_initialize.c arch: Change the linker generated symbols from uint32_t to uint8_t * 2022-09-24 21:26:56 +02:00
lib_debug.c nuttx: add some missing FAR 2022-12-21 10:56:45 +08:00
lib_dumpbuffer.c libc: add lib_dump utils 2022-08-24 16:58:10 +08:00
lib_dumpvbuffer.c libc: add lib_dump utils 2022-08-24 16:58:10 +08:00
lib_envpath.c Replace all sprintf with snprintf 2023-05-08 09:57:01 +02:00
lib_err.c sched/getpid: replace syscall getpid/tid/ppid() to kernel version 2023-02-02 10:33:01 +08:00
lib_execinfo.c libc: backtrace_malloc change sprintf to snprintf 2022-01-20 14:33:29 +01:00
lib_fchmodat.c libc: Add a new argument(size_t fulllen) to lib_getfullpath 2023-05-08 09:57:01 +02:00
lib_fdsan.c libc/misc: add fdsan module 2023-05-17 10:24:42 +08:00
lib_fnmatch.c libc: Rename match to fnmatch 2021-08-02 08:23:35 -03:00
lib_fstatat.c libc: Add a new argument(size_t fulllen) to lib_getfullpath 2023-05-08 09:57:01 +02:00
lib_ftok.c libc/ftok: Map token to the root pseduo file system directory 2022-09-20 16:21:06 +08:00
lib_getfullpath.c libc: Add a new argument(size_t fulllen) to lib_getfullpath 2023-05-08 09:57:01 +02:00
lib_getrandom.c libc: Fix getrandom() bug: Didn't propagate read error 2022-07-01 11:51:53 +08:00
lib_glob.c Fix compiler warnings (-Wunused-parameter) in various functions 2022-07-12 11:42:34 +08:00
lib_impure.c newlib/impure: declare thread specific file only if __NEWLIB__ is defined. 2022-10-12 17:22:24 +08:00
lib_kbddecode.c libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc) 2022-12-05 14:27:55 +01:00
lib_kbdencode.c libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc) 2022-12-05 14:27:55 +01:00
lib_memfd.c libc: Move memfd related stuff to sys/mman.h 2023-02-13 16:00:37 +01:00
lib_mkdirat.c libc: Add a new argument(size_t fulllen) to lib_getfullpath 2023-05-08 09:57:01 +02:00
lib_mkfifo.c libc: Add a new argument(size_t fulllen) to lib_getfullpath 2023-05-08 09:57:01 +02:00
lib_mknod.c libc: Add a new argument(size_t fulllen) to lib_getfullpath 2023-05-08 09:57:01 +02:00
lib_mutex.c misc/mutex: fix assertion if nxmutex_reset() before nxmutex_unlock() 2023-02-04 02:13:15 +08:00
lib_ncompress.c Remove the remain MIN/MAX like macro 2023-02-03 23:22:41 +08:00
lib_openat.c libc: Add a new argument(size_t fulllen) to lib_getfullpath 2023-05-08 09:57:01 +02:00
lib_slcddecode.c libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc) 2022-12-05 14:27:55 +01:00
lib_slcdencode.c libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc) 2022-12-05 14:27:55 +01:00
lib_tea_decrypt.c libs: Gregory Nutt: update licenses to Apache 2021-04-02 11:12:25 -05:00
lib_tea_encrypt.c libs: Gregory Nutt: update licenses to Apache 2021-04-02 11:12:25 -05:00
lib_uadd32x64.c libs: Gregory Nutt: update licenses to Apache 2021-04-02 11:12:25 -05:00
lib_uadd64.c libs: Gregory Nutt: update licenses to Apache 2021-04-02 11:12:25 -05:00
lib_umask.c fs: Save umask to tls_task_s for non kernel mode only 2021-08-02 15:59:51 -03:00
lib_umul32.c libs: Gregory Nutt: update licenses to Apache 2021-04-02 11:12:25 -05:00
lib_umul32x64.c libs: Gregory Nutt: update licenses to Apache 2021-04-02 11:12:25 -05:00
lib_umul64.c libs: Gregory Nutt: update licenses to Apache 2021-04-02 11:12:25 -05:00
lib_usub64.c libs: Gregory Nutt: update licenses to Apache 2021-04-02 11:12:25 -05:00
lib_usub64x32.c libs: Gregory Nutt: update licenses to Apache 2021-04-02 11:12:25 -05:00
lib_utimensat.c libc: Add a new argument(size_t fulllen) to lib_getfullpath 2023-05-08 09:57:01 +02:00
lib_utsname.c Replace all strncpy with strlcpy for safety 2022-08-25 13:38:36 +08:00
lib_xorshift128.c nuttx: Author David S. Alessio: update licenses to Apache 2021-03-22 19:28:38 -07:00
Make.defs libc/misc: add fdsan module 2023-05-17 10:24:42 +08:00