fix: Grant gdb ptrace capabilities so the end-to-end CI job passes - #3
Merged
Merged
Conversation
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.
Summary
The
integration(end-to-end) CI job failed onmasterafter #2 merged. The unit tests passed; the parser correctly extracted the shielded key and prekey. The failure was in the gdb unshield step:Root cause
decrypt.gdbline 5 makes gdb call a function inside the livessh-keygeninferior (getenv(...)). Performing an inferior call requires gdb to save and restore the process's extended CPU register state viaptrace(PTRACE_SETREGSET, NT_X86_XSTATE), and it also tries to disable ASLR. Inrun-test.shtheshieldbreakcontainer ran without ptrace privileges, so on the GitHub runner's restricted seccomp/ptrace sandbox those calls were blocked.This is why it was flaky: it worked where the host happened to allow the ptrace calls (local, and the earlier PR run) and failed where it did not (the
masterrunner).Fix
Run the extraction container with the standard "gdb in Docker" flags,
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined, intest/run-test.sh. The same flags are added to the documenteddocker runin the README and the example inentrypoint.sh, since any real use of the tool drives gdb the same way and needs them.Testing
make testlocally now passes with matching fingerprints and noBad addresserror:CI will confirm on the runner (the workflow now exists on
master, so this PR triggers it).