nuttx/fs
liamHowatt 081c2337b7 fs/userfs: keep lock while reading iobuffer
Fix a race on userfs_state_s iobuffer.

1. Task 1 takes the mutex and does a userfs operation.
2. A higher priority task 2 blocks on the mutex.
3. Task 1 releases the mutex when finished. The iobuffer response has not
   been processed by task 1 yet, but task 2 is higher priority
   and control switches to it.
4. Task 2 does a userfs operation and releases the mutex.
   The iobuffer now contains task 2's response.
5. Control returns to task 1 for it to check the iobuffer
   response. It contains task 2's response, not its own.

Fix it by releasing the mutex only after the exclusive iobuffer
usage lifecycle is complete.

Signed-off-by: liamHowatt <liamjmh0@gmail.com>
2026-01-11 09:01:45 -03:00
..
aio fs/file: unify prefix about file_xxx api, like file_open, file_ioctl 2025-06-12 18:12:42 +08:00
binfs fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
cromfs fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
driver fs/fs.h: Add register_driver_with_size function 2025-11-13 08:57:52 -03:00
event fs: Move inotify.c from fs/notify/ to fs/vfs/ 2025-06-23 18:17:10 -03:00
fat fs/fat: Ignore multiple consecutive slashes in long file names 2025-11-27 22:26:56 +08:00
hostfs style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
inode fs/inode: use file_allocate,file_dup to avoid racecondition to allocate fd 2026-01-09 17:11:25 +08:00
littlefs littlefs: fix statfs underflow during active writes 2025-12-29 14:23:04 +08:00
mmap fs/mmap/Kconfig: fix reference to non-existent readme 2025-10-11 17:07:51 -04:00
mnemofs style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
mount fs: Move inotify.c from fs/notify/ to fs/vfs/ 2025-06-23 18:17:10 -03:00
mqueue fs/inode: use file_allocate,file_dup to avoid racecondition to allocate fd 2026-01-09 17:11:25 +08:00
nfs style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
nxffs style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
partition style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
procfs mm:use Kconfig to control sequence number to save memory 2025-12-20 09:47:22 -03:00
romfs Revert "romfs:extend romfs to enable write" 2025-12-24 07:41:28 -03:00
rpmsgfs sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
semaphore bugfix:the inode may have been removed by other core in SMP 2025-12-16 16:02:46 -03:00
shm fs/inode: use file_allocate,file_dup to avoid racecondition to allocate fd 2026-01-09 17:11:25 +08:00
smartfs fs/smartfs: Fix a fatal bug about sector writing after seek 2025-06-13 20:42:36 +08:00
socket fs/vfs: Separate file descriptors from file descriptions 2025-06-12 18:12:42 +08:00
spiffs style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
tmpfs tmpfs:fix memoryleak of tmpfs_opendir 2025-12-22 11:02:10 -05:00
unionfs style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
userfs fs/userfs: keep lock while reading iobuffer 2026-01-11 09:01:45 -03:00
v9fs refactor: fix spelling in private field names 2025-05-24 09:44:22 -03:00
vfs fs/inode: use file_allocate,file_dup to avoid racecondition to allocate fd 2026-01-09 17:11:25 +08:00
zipfs fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
CMakeLists.txt fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
fs_heap.c fs_heap:add fs_heap_mallinfo_task 2025-01-15 17:12:50 +08:00
fs_heap.h fs_heap:add fs_heap_mallinfo_task 2025-01-15 17:12:50 +08:00
fs_initialize.c fs: Move inotify.c from fs/notify/ to fs/vfs/ 2025-06-23 18:17:10 -03:00
Kconfig fs: Move inotify.c from fs/notify/ to fs/vfs/ 2025-06-23 18:17:10 -03:00
Makefile fs: Move inotify.c from fs/notify/ to fs/vfs/ 2025-06-23 18:17:10 -03:00