Files
nuttx/fs/userfs
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
..
2024-11-06 01:58:54 +08:00
2024-11-06 01:58:54 +08:00
2024-11-06 01:58:54 +08:00