mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3045] Ping Broken #1910
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#1910
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 @blinux45 on GitHub (Nov 14, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3045
I am reopening ticket #2970, "Ping Broken", because there is a bug:
https://github.com/netblue30/firejail/issues/2970
PRELIMINARY
$ ls -lA /bin/ping
-rwxr-xr-x 1 root root 68076 Nov 10 2016 /bin/ping
Please not that ping is not setuid.
TEST #1
$ firejail --noprofile ping -c1 192.168.1.1
Parent pid 5278, child pid 5279
Child process initialized
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.441 ms
--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.441/0.441/0.441/0.000 ms
Ping works
TEST #2
$ firejail --noprofile --private-bin=bash,ping --caps.keep=net_raw ping -c1 192.168.1.1
Parent pid 5374, child pid 5375
Child process initialized
ping: socket: Operation not permitted
Parent is shutting down, bye...
Ping does not work, despite having the appropriate capabilities.
@Vincent43 commented on GitHub (Nov 14, 2019):
No, it doesn't have appropriate capabilities. As nosuid description states:
So this is same issue where
nosuidis applied unconditionally withprivate-binoption. As stated in https://github.com/netblue30/firejail/issues/2970#issuecomment-541425259 discussion should continue in https://github.com/netblue30/firejail/issues/2969 .@blinux45 commented on GitHub (Nov 18, 2019):
This is not simply a nosuid issue.
To prove it, let's run the following tests:
Test #1: Setup
$ mkdir /var/bin2
$ mount -o ro,bind,nosuid /bin/ /var/bin2/
$ mount -o remount,nosuid /bin /var/bin2/
Let us verify
$ mount | grep bin2
/dev/sda99 on /var/bin2 type ext4 (rw,nosuid,relatime,errors=remount-ro,data=ordered)
We can see that /var/bin2 is nosuid
$ ls -lA /var/bin2/ping
-rwxr-xr-x 1 root root 68076 Nov 10 2016 /var/bin2/ping
ping does not have suid and doesn't require it as was shown in my first post.
Test #2: Running ping on /var/ping2
$ /var/bin2/ping -c1 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.501 ms
--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.501/0.501/0.501/0.000 ms
ping works and /var/bin2 is nosuid !
@Vincent43 commented on GitHub (Nov 19, 2019):
What distro you use?
@blinux45 commented on GitHub (Nov 22, 2019):
debian 9 stretch