Dangling Symlink Resolution and Missing sync_file_range and syncfs System Calls#110
Open
doanbaotrung wants to merge 1 commit into
Open
Dangling Symlink Resolution and Missing sync_file_range and syncfs System Calls#110doanbaotrung wants to merge 1 commit into
doanbaotrung wants to merge 1 commit into
Conversation
f381049 to
be86962
Compare
There was a problem hiding this comment.
2 issues found and verified against the latest diff
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
In fs.c, the sys_renameat2 and sys_linkat system calls were using the resolving PATH_TR_NONE translation mode for the source paths. This caused elfuse to follow the symlink leaf names to their targets, causing dangling symlinks during package extraction to fail with ENOENT (No such file or directory). We updated these to use PATH_TR_NOFOLLOW for the leaf components, preventing path resolution from walking past the symlink itself. Missing sync_file_range and syncfs System Calls: We registered and defined SYS_sync_file_range (84) and SYS_syncfs (267) in abi.h and dispatch.tbl, and implemented them in syscall.c as aliases of sc_fsync_common.
be86962 to
23ab75d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the
sys_renameat2andsys_linkatsystem callswere using the resolving PATH_TR_NONE translation
mode for the source paths.
This caused elfuse to follow the symlink
leaf names to their targets, causing
dangling symlinks during package extraction
to fail with ENOENT (No such file or directory).
We updated these to use PATH_TR_NOFOLLOW for
the leaf components, preventing path resolution
from walking past the symlink itself.
Missing sync_file_range and syncfs System
Calls: We registered and defined
SYS_sync_file_range (84) and
SYS_syncfs (267) in abi.h and dispatch.tbl,
and implemented them in syscall.c as
aliases of sc_fsync_common.
Summary by cubic
Fixes dangling symlink handling in rename/link to avoid ENOENT during package extraction and implements shims for
SYS_sync_file_range(84) andSYS_syncfs(267) to avoid ENOSYS.Bug Fixes
renameat2andlinkatstop following leaf symlinks usingPATH_TR_NOFOLLOW;linkathonorsAT_SYMLINK_FOLLOWon the source. New paths usePATH_TR_CREATE | PATH_TR_NOFOLLOW.New Features
SYS_sync_file_rangeandSYS_syncfsinabi.h/dispatch.tbl.sync_file_rangevalidates flags, returns immediately for WRITE-only, and usesfsync(fd)when WAIT flags are set.syncfsopens the fd then callssync()to flush all filesystems.Written for commit 23ab75d. Summary will update on new commits.