Skip to content
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

firejail: fix -overlay and -build functionality on NixOS #105182

Merged
merged 1 commit into from Nov 28, 2020

Conversation

roosemberth
Copy link
Contributor

  • The -overlay flag runs the specified binary inside an OverlayFS,
    since the /nix store may be in a different mount point than the user
    home, this patch explicitly bind mounts it so it's available inside
    the overlay.

  • profile builder: firejail provides facilities to build a new profiles.
    To do so, it execute the helper binary fbuilder, which in turn will
    execute firejail back with different options. This patch makes it use
    the binary available in PATH instead of the one produced at compile time.
    The compiled firejail binary doesn't have the necessary permissions,
    so the firejail NixOS module wraps it in a SUID wrapper available on
    PATH at runtime.

Signed-off-by: Roosembert Palacios roosemberth@posteo.ch

Mind that testing with nixos-rebuild build-vm does not work because build-vm itself uses an overlayfs to mount the nix store.

Motivation for this change

Fixing non-working functionality of firejail.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

- The `-overlay` flag runs the specified binary inside an OverlayFS,
  since the /nix store may be in a different mount point than the user
  home, this patch explicitly bind mounts it so it's available inside
  the overlay.

- profile builder: firejail provides facilities to build a new profiles.
  To do so, it execute the helper binary `fbuilder`, which in turn will
  execute firejail back with different options. This patch makes it use
  the binary available in PATH instead of the one produced at compile time.
  The compiled firejail binary doesn't have the necessary permissions,
  so the firejail NixOS module wraps it in a SUID wrapper available on
  PATH at runtime.

Signed-off-by: Roosembert Palacios <roosemberth@posteo.ch>
@ofborg ofborg bot requested a review from 7c6f434c November 27, 2020 22:40
roosemberth added a commit to roosemberth/dotfiles that referenced this pull request Nov 27, 2020
Signed-off-by: Roosembert Palacios <roosemberth@posteo.ch>
@7c6f434c 7c6f434c merged commit 2d50a1f into NixOS:master Nov 28, 2020
@roosemberth roosemberth deleted the fixes/firejail branch November 28, 2020 14:46
roosemberth added a commit to roosemberth/dotfiles that referenced this pull request Nov 30, 2020
NixOS/nixpkgs#105182 was merged.

This reverts commit da8ccaf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants