Skip to content

syscall: use O_PATH for directory traversal - #1052

Open
steadytao wants to merge 1 commit into
RsyncProject:masterfrom
steadytao:fix/termux-destination-chdir
Open

syscall: use O_PATH for directory traversal#1052
steadytao wants to merge 1 commit into
RsyncProject:masterfrom
steadytao:fix/termux-destination-chdir

Conversation

@steadytao

Copy link
Copy Markdown
Member

Fixes #1050

Summary

  • use O_PATH for intermediate directory descriptors in the ownership-checked path walk where supported
  • reopen a fully resolved directory with the caller's requested access mode before returning it
  • add regression coverage for destinations below searchable but unreadable directories

Android permits traversal through / to /sdcard but does not permit Termux to open / with O_RDONLY | O_DIRECTORY. The hardened destination walk therefore failed before reaching the destination even though the intermediate directories were searchable.

@steadytao
steadytao force-pushed the fix/termux-destination-chdir branch 2 times, most recently from baa4d45 to de6b0c7 Compare August 13, 2026 19:24
@steadytao
steadytao force-pushed the fix/termux-destination-chdir branch from de6b0c7 to 56e37ea Compare August 13, 2026 19:32
@p-linnane p-linnane mentioned this pull request Aug 13, 2026
@p-linnane

Copy link
Copy Markdown

Noting that this PR also fixes our Landlock sandboxing issue in Homebrew: Homebrew/homebrew-core#298558

@steadytao

steadytao commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Ah, yes, it very well would. Thank you.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3.5.0 fails under termux

2 participants