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

   ## Summary
   
   `v9fs_client_rpc()` ignores the result of `nxsem_wait()`. When a signal 
wakes the caller, the function returns -EIO while the request is still in the 
transport. The `payload` and the response buffers are on the stack of the 
caller. The reply then goes into a stack frame that is already gone.
   
   This PR waits again until the reply arrives.
   
   ## Impact
   
   v9fs. A signal no longer gives an I/O error on a 9P file operation, and no 
longer corrupts the kernel stack of another thread. A thread that gets a signal 
during a 9P request now waits until the request completes, then runs its signal 
handler.
   
   ## Testing
   
   `qemu-armv8a:knsh` with a virtio 9P share, 4 CPUs, with this commit on a 
larger local branch. A parent that gets SIGCHLD while it reads a file from the 
share.
   
   Before: the read failed with "I/O error". Other threads then jumped to 
garbage PCs, or faulted in `v9fs_transport_done()` in interrupt context.
   
   After: no I/O errors and no faults.
   
   Build: `qemu-armv8a:nsh` and `qemu-armv8a:knsh`.
   


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