MTimeProtectedFastFileStorage writes it's data out to a temp file, then renames it.

the temp file path is not unique, so two processes writing the same entry at the same time, with different data, can clobber each others work.

attached patch makes sure to use tempnam() for the temporary path.

CommentFileSizeAuthor
storage-race-lulz.patch1.29 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Status: Needs review » Reviewed & tested by the community

A race condition like that is borderline impossible to test, so RTBC if bot agrees.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Wow, very nice find!

Committed and pushed to 8.x. Thanks!

  • Commit 4027cab on 8.x by webchick:
    Issue #2240023 by beejeebus: Make sure we use a unique temp filename for...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.