Skip to content

Conversation

@Dolphindalt
Copy link

@Dolphindalt Dolphindalt commented Jan 5, 2026

Description

See #10023 for details on the vulnerability and how to test/reproduce.

This PR fixes the vulnerability by using atomic exclusive creation with the O_EXCL flag.

  • create_new() ensures the file is created atomically
  • Fails if anything exists at the path (including symlinks)
  • Prevents following symlinks, even if created during the race window

Testing

@cakebaker cakebaker linked an issue Jan 5, 2026 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@Dolphindalt
Copy link
Author

I suspect that the failure is a flaky test as it is unrelated to the changes. I pulled in the latest changes from main just in case.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

GNU testsuite comparison:

GNU test failed: tests/tty/tty-eof. tests/tty/tty-eof is passing on 'main'. Maybe you have to rebase?

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 6, 2026

CodSpeed Performance Report

Merging #10067 will not alter performance

Comparing Dolphindalt:main (ba34629) with main (adebe06)

Summary

✅ 139 untouched
⏩ 37 skipped1

Footnotes

  1. 37 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install TOCTOU symlink race: unlink-then-create without O_EXCL

1 participant