Repository navigation
Conversation
--overlay-src only increments a counter; when the matching overlay option is parsed, the source paths are recovered by indexing backwards from that option's argv. If the overlay option comes from an --args file, the recursive parser is working with a different argv, so the backwards indexing reads before the start of the file's argument vector and crashes. The requirement that --overlay-src be followed by an overlay option applies within one argument list, so reject the combination with the error message already used for a stray --overlay-src, instead of recursing into the file. Fixes containers#828 Signed-off-by: syokensyo <8558176+syokensyo@users.noreply.github.com>
Contributor
|
What is better/different to #829? |
Author
|
Thanks — you're right, this is the same fix as #829, and #829 came first. I missed it while triaging #828; sorry for the duplicate. The code change is identical: the same guard in I'll close this in favour of #829 to avoid duplicate work. If the stricter exit-status assertion is useful, I'm happy to add it to #829 instead. |
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.
Problem
--overlay-srconly increments a counter. When the matching overlay option is parsed, the source paths are recovered by indexing backwards from that option's position inargv. If the overlay option comes from an--argsfile, the recursive parser is working with a differentargv, so the backwards indexing runs before the start of the file's argument vector and bwrap crashes:Change
--overlay-srchas to be followed by another--overlay-srcor an overlay option within the same argument list. Reject the combination with--argsusing the error message that is already used for a stray--overlay-src, instead of recursing into the file.Verification
tests/test-run.sh. Before the change it crashes with exit status 139; after the change it fails cleanly with the expected message.meson test -C _build: 5 passed, 1 skipped (test-seccomp.py, no seccomp in this environment), 0 failed.Fixes #828
Signed-off-by: syokensyo 8558176+syokensyo@users.noreply.github.com