fix: register qemu binfmt_misc with CF flags to preserve suid#45
Open
meteyou wants to merge 3 commits into
Open
fix: register qemu binfmt_misc with CF flags to preserve suid#45meteyou wants to merge 3 commits into
meteyou wants to merge 3 commits into
Conversation
Signed-off-by: Stefan Dej <meteyou@gmail.com>
…rchitectures Signed-off-by: Stefan Dej <meteyou@gmail.com>
…ng for Debian bookworm and trixie Signed-off-by: Stefan Dej <meteyou@gmail.com>
Contributor
Author
|
I tested all PRs together and found out, that Trixie changed some stuff from qemu. I fixed all Trixie bugs and commited it. Here is the test run: meteyou/CustoPiZer-dev/actions/runs/25258220249 |
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.
When cross-building an arm image on a non-arm host (e.g. x86 ubuntu-latest GitHub Actions runners), suid binaries executed inside the chroot silently dropped their privileges. Most notably
sudowould fail with permission errors, breaking any chroot script that relied on it.Register the qemu binfmt entry directly via
/proc/sys/fs/binfmt_misc/registerwith theCFflags:CFPositive side effects:
Because the
Fflag pins the interpreter fd across chroot boundaries, we no longer need to:qemu-*-staticinto the target rootfs, orchrootThe
$QEMUvariable is therefore always empty and has been removed fromchrootinvocations insrc/customizeandsrc/enter_image.I tested also a full build with MainsailOS here: https://github.com/mainsail-crew/MainsailOS/actions/runs/25255479547?pr=363