mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 13:26:00 +03:00
[GH-ISSUE #633] Potential atomic violation in S3fsCurl::AddUserAgent #363
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#363
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ITWOI on GitHub (Aug 29, 2017).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/633
Additional Information
The following information is very important in order to help us to help you. Omission of the following details may delay your support request or receive no attention at all.
Version of s3fs being used (s3fs --version)
Master Branch
Version of fuse being used (pkg-config --modversion fuse)
N/A
System information (uname -a)
N/A
Distro (cat /etc/issue)
N/A
Details about issue
Hi all,
Our bug scanner has reported a race condition issue from curl.cpp#L1486 to curl.cpp#L1495
Followings are code snippets.
Note that
initis a static variable and the functionAddUserAgentcould be executed parallelly. Therefore, when two threads reach theif(!init)simultaneously, they are all true and then begin to construct the stringstrua. However, they could corrupt thestrua, leading to confused information.A possible call trace could be as follows:
S3fsMultiCurl::MultiPerformcreates two or more threads that executeS3fsMultiCurl::RequestPerformWrapper. ThenS3fsMultiCurl::RequestPerformWrappercallsS3fsCurl::RequestPerform. At the end ofS3fsCurl::RequestPerform, it callsS3fsCurl::AddUserAgent(hCurl).SourceBrella Inc.,
Yu
@ggtakec commented on GitHub (Sep 17, 2017):
@ITWOI Thanks for this.
I modified and merged new codes, you can see it(and detail in PR).
Regards,