RTEMS | open: Fix race condition when called with O_TRUNC (!178)

Loris Nardo (@loris.nardo) gitlab at rtems.org
Thu Aug 8 05:23:14 UTC 2024



Loris Nardo created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/178

Project:Branches: loris.nardo/rtems:open-truncate-race-close to rtems/rtos/rtems:main
Author:   Loris Nardo




## Summary

open: Fix race condition when called with O_TRUNC

Fix a race condition in which a file opened with O_TRUNC is made available to other file functions expecting a file descriptor before the truncation is performed.

This is only possible if the other thread was using an invalid file descriptor as the open call has yet to finish.

Closes #5109


<!-- Default settings, if it is a dropdown it will set after submission -->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/178
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240808/bf45082d/attachment.htm>


More information about the bugs mailing list