90387a5b41
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> |
||
---|---|---|
.. | ||
fs_files.c | ||
fs_foreachinode.c | ||
fs_inode.c | ||
fs_inodeaddref.c | ||
fs_inodebasename.c | ||
fs_inodefind.c | ||
fs_inodefree.c | ||
fs_inodegetpath.c | ||
fs_inoderelease.c | ||
fs_inoderemove.c | ||
fs_inodereserve.c | ||
fs_inodesearch.c | ||
inode.h | ||
Make.defs |