Repository navigation
Enforce RLIMIT_FSIZE on regular-file writes #463
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
Open
xalestar
wants to merge
8
commits into
sysprog21:main
Choose a base branch
from
xalestar:rlimit-fsize
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,792
−22
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
eb20204
Check copy_file_range's ends before copying
xalestar 7d0851f
Refuse a copy_file_range range that wraps
xalestar 34b6e68
Refuse an O_APPEND output in sendfile and splice
xalestar f1a1150
Honor SPLICE_F_NONBLOCK in splice
xalestar 81ec4d7
Append on a pwrite to an O_APPEND descriptor
xalestar a85f131
Refuse a pwrite whose range does not fit off_t
xalestar 0a9306a
Ignore host SIGXFSZ in elfuse
xalestar 081a1fa
Enforce RLIMIT_FSIZE on regular-file writes
xalestar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignoring SIGXFSZ avoids the crash, but a guest that raises its soft
RLIMIT_FSIZEup to its hard limit still getsEFBIGfrom the host's lower soft limit. Linux lets that write through. Now that elfuse enforces the guest limit itself, raising the host softRLIMIT_FSIZEto the host hard limit at startup (after the guest table is seeded) would remove that gap. KeepSIG_IGNfor the hard-limit case. The newtests/test-rlimit-seed.shblock asserts theEFBIGand would need to expect success instead.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 0a9306a. After
sys_rlimit_initseeds the guest table, it raises the host softRLIMIT_FSIZEto the host hard limit. This happens beforehost_rlimit_check_armrecords the host limits.SIG_IGNstays, for a guest that raises its limit past the host hard limit. Thetests/test-rlimit-seed.shcase now expects the write to land, with an 8192-byte file underulimit -S -f 4. Its new case "boots under a host hard file size limit" runs underulimit -f 4. All 9 cases pass on elfuse. On 9f5ed24 the write case fails.