-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
See this PR for more information.
This issue can be used to figure out a way out of this without breakage, while reducing risk of this UB to be exploited at some point.
What we did so far
- make multi-threaded usage on linux and freebsd safe by synchronizing the function call, knowing that this will reduce multi-threaded 'trashing' somewhat and be ineffective in case calls are made directly to
libc::getmnt*()from other threads. - yank all v2.0 versions prior to v2.0.4 as they contained the use of
getmntent()
How to fix Linux
This fix reduces chances of UB to zero and makes the Mutex unnecessary.
- use
getmntent_r()instead ofgetmntent()
How to fix FreeBSD
This fix reduces chances of UB to zero and makes the Mutex unnecessary.
- Use
getfsstatdirectly, which avoids the statically allocated buffers entirely. Thanks, @avitex, for the suggestion.
That's all we know.
Metadata
Metadata
Assignees
Labels
No labels