hujun260 opened a new pull request, #9260:
URL: https://github.com/apache/nuttx/pull/9260

   ## Summary
   
   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, and 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
   
   ## Impact
   none
   
   ## Testing
   ostest
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to