mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 22:01:33 -06:00
[GH-ISSUE #1376] Grsecurity, Firejail and Bridge Networking #940
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#940
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 @biergaizi on GitHub (Jul 13, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1376
Grsecurity, Firejail and Bridge Networking
This issue is intended to document a problem on Grsecurity's kernel. It is not an issue of firejail at all. I just want to document this issue to help others who may encounter the same problem in the future.
firejail is a sandboxing program which utilizes the namespace functionality of the Linux kernel.
One of its feature is creating an isolated the network namespace,
Unfortunately, it doesn't work with Grsecurity kernel. If firejail is executed as root instead, it will work as expected.
From the debug log, we observe a
vethinterface is created by firejail for networking under normal operations.but a
macvlanis created instead on Grsecurity kernel without root.Inspecting the source code, we identified the source of the problem in network_main.c.
firejail relies on information from
/sys/class/netto decide whether it is a bridge device or an Ethernet interface, ifCONFIG_GRKERNSEC_SYSFS_RESTRICTis enabled on a Grsecurity kernel, these files will be inaccessible by regular users to prevent information leaks.The solution is to disable
CONFIG_GRKERNSEC_SYSFS_RESTRICTin Grsecurity's kernel configuration, on a desktop system, this option should not be enabled anyway since it creates compatibility issues with many desktop programs.Manually running
chmodto hack these permissions is another solution. Since/sys/class/netcontains symbol links to other directories, permissions of other directories, such as/sys/devices/virtual/netshould be also changed.Since hiding
/sysis generally desirable on security-focused production servers, an alternative approach is to change the source code of firejail if feasible, e.g. add an option to allow users to choice the interface type.@Ferroin commented on GitHub (Jul 13, 2017):
Even without the grsecurity specific bit, I think adding an option to manually select the interface type is a good idea, both for completeness/testing, and because there are paranoid people like me who manually set permissions on /sys to deny access for unprivileged users even though we're not using grsecurity kernels.
@rusty-snake commented on GitHub (Apr 1, 2020):
Anything to go here?
@biergaizi commented on GitHub (May 6, 2020):
@rusty-snake Nothing. Perhaps I should submit a patch then?