Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle O_PATH correctly with fchmodat(2) and utimensat(2). #9468

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Oct 5, 2023

Handle O_PATH correctly with fchmodat(2) and utimensat(2).

  • As an optimization, when path was empty and it was allowed to use empty path,
    setstatat() was invoking the FD-impl directly, instead of going through the
    FS-impl, in hopes that open FDs can perform these operations more quickly.
    However, this optimization breaks fchmodat(AT_EMPTY_PATH) for O_PATH FDs
    because O_PATH FD-impl rejects SetStat() operation. So disabled this
    optimization for O_PATH FDs.
  • However, this fix revealed that we were now allowing utimes() operations on
    O_PATH FDs via utimensat(opathFD, path=NULL). Linux disallows this as
    mentioned in the patch. So fixed utimes codebase to emulate Linux accurately.

Fixes #9453

@copybara-service copybara-service bot added the exported Issue was exported automatically label Oct 5, 2023
@copybara-service copybara-service bot changed the title Handle O_PATH correctly with fchmodat(2) and utimensat(2) Handle O_PATH correctly with fchmodat(2) and utimensat(2). Oct 5, 2023
@copybara-service copybara-service bot force-pushed the test/cl571134499 branch 2 times, most recently from 6b729f9 to 3165795 Compare October 5, 2023 23:37
@copybara-service copybara-service bot closed this Oct 6, 2023
@copybara-service copybara-service bot deleted the test/cl571134499 branch October 6, 2023 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exported Issue was exported automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fchownat not respecting AT_EMPTY_PATH on file descriptors opened with O_PATH
0 participants