mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3781] Rootless Firejail re-entry to Firejail created network namespace: Error: cannot join netns 'wgsh': Invalid argument #2385
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2385
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bbros-dev on GitHub (Dec 1, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3781
Thanks for all the effort you have put into firejail and for making it open source.
It is not clear if the following is possible or even within scope. If the following should work, I'd appreciate any insights into what is missing or incorrect.
The
sudo firejail --netns=xyz ....is unattractive becausesudois required.In this respect Firejail is no different from using the following
nsentercommand which works, but also has the
sudorequirement:A naive attempt to workaround this is, from within a Firejailed
sudo bash:Ideally it would be possible to:
This issue reports that 1) appears to be achieved, there is a
/var/run/netns/wgshcreated.However 2) does not seem possible. A simple attempt to start a shell inside this Firejail created network namespace fails.
The network namespace is present but no one has access.
Allowing all users full
rwxaccess produces this behavior:First, rootless:
Then trying as root:
The following reports the fact that no errors were reported in setting up the network namespace.
The network namespace and WireGuard commands complete without generating any errors. Entering the network names space just created inside Firejail shows WireGuard is connected as expected. So the difficulty is getting backinto that same netns after exiting Firejail.
Bug and expected behavior
firejail --noprofile --netns=wgshshould place the rootless user back inside the netns they just created.No profile and disabling firejail
firejail --noprofile /path/to/programin a terminal? Firejail already used--noprofilewhich <program>orfirejail --listwhile the sandbox is running)? No change. We open a bash shell and then switch to root to initally setup the network namespace and WireGuard without issue. Trying to regain entry to that nstns is problematic.Reproduce
Steps to reproduce the behavior:
$ mkdir -p ~/.local/share/wgsh$ firejail --noprofile --net=enp2s0 --private=~/.local/share/wgshNow try to re-enter the network namespace
Environment
Additional context
Other context about the problem like related errors to understand the problem.
Checklist
--noprofileThe upstream profile (and redirect profile if exists) have no changes fixing it.The program has a profile. (If not, request one inhttps://github.com/netblue30/firejail/issues/1139)Programs needed for interaction are listed in the profile.If it is a AppImage,--profile=PROFILENAMEis used to set the right profile.LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAMto get english error-messages.debug output