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

   
   
   ## Summary
   Revert "fs/inode: add pre-allocated task files to avoid allocator access
   
   This reverts commit 086834aae1722af2797fd5d4d0f79226ac11c2e9.
   
   The refs in the filelist cannot protect the handles in the prefiles The 
prefiles and its associated group are allocated together, and when the group 
leaves, they are released together.
   During a reboot process, the sync operation may encounter a "used after 
free" issue.
   
   issue stack:
   
       (filep=filep@entry=0x3c482770) at ../../../fs/vfs/fs_close.c:80
       ../../../fs/vfs/fs_close.c:118
       ../../../fs/inode/fs_files.c:476
       /home/cibuild/Public/jenkinsversion/2148/nuttx/include/nuttx/fs/fs.h:870
       at ../../../fs/inode/fs_files.c:223
       <task_fssync(tcb_s*, void*)>, arg=0x0) at
   ../../../sched/sched/sched_foreach.c:73
       data=<optimized out>) at ../../../fs/fs_initialize.c:48
       ../../../sched/misc/reboot_notifier.c:87
       ../../../boards/boardctl.c:415
       argv=0x3d3e07e8) at ../../../../apps/nshlib/nsh_syscmds.c:465
       argc=argc@entry=2, argv=0x3d3e07e8, argv@entry=0x3d3e0820)
       at ../../../../apps/nshlib/nsh_command.c:1247
       argv=0x3d3e0820, argc=2, vtbl=0x3c5d2aa8) at
   ../../../../apps/nshlib/nsh_parse.c:847
       cmdline=cmdline@entry=0x3d3df93a "reboot") at
   ../../../../apps/nshlib/nsh_parse.c:2757
       "reboot") at ../../../../apps/nshlib/nsh_parse.c:2844
       argc=argc@entry=3, argv=0x3d3df920) at
   ../../../../apps/nshlib/nsh_session.c:146
       char**)>, isctty=isctty@entry=0) at
   ../../../../apps/nshlib/nsh_system.c:47
       out>) at ../../../../apps/nshlib/nsh_system.c:80
       entrypt=<optimized out>) at
   ../../../libs/libc/sched/task_startup.c:70
   
   And the original prefile improvement was only 3 microseconds, which is very 
minimal, so reverting it is the best approach.
   
   
   ## Impact
   
   Bug fix
   
   ## Testing
   
   local test
   
   
   


-- 
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