mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2100] seccomp filtering not working with chroot #1420
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#1420
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 @reinerh on GitHub (Aug 29, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2100
Originally assigned to: @netblue30 on GitHub.
The Debian security team received a report that using
--seccomptogether with--chrootdoes not work as one would expect.If the libpostexecseccomp.so library is missing inside the chroot, the syscalls are not actually filtered.
For example:
As firejail is already checking that a certain directory hierarchy is present inside the chroot (/dev, /etc, /var/tmp, ...), it should also check that the required libraries it (pre)loads are there.
It should also be documented how the chroot should look like if one wants to use all firejail features.
@smitsohu commented on GitHub (Aug 30, 2018):
I was also thinking if we maybe can expect from users to actually turn chroot on in firejail.config (and ship firejail with it turned off by default). That's a different topic though.
@netblue30 commented on GitHub (Aug 30, 2018):
It is a different bug! By default for --chroot, --overlay-* and --appimage we do the following:
If any of these fail, we don't start the sandbox. For example it will fail on kenel 3.2 where there is no seccomp available. For --chroot sandboxes seccomp will always run. This can be easily checked from firetools or with --seccomp.print. Example:
In a different terminal I check the test sandbox:
We have two bugs:
Document everything in the man pages
Get rid of the ld.so messages. Somehow the sandbox still tries to install the postexec seccomp filter, but this filter is an empty file (it was replaced by the regular seccomp filter), and the postexec loader is missing anyway.
I'll bring in the fixes.
@reinerh commented on GitHub (Aug 30, 2018):
@netblue30 I think firejail shouldn't start the program if it was explicitely requested that some syscalls are dropped, instead of running it with default filters.
@netblue30 commented on GitHub (Sep 1, 2018):
It won't work. Most of the time the user has no idea where the filters are coming from (profile files), and some profiles are modifying the seccomp filter. For example in --overlay and --appimage (firejail --overlay firefox). It is better just to leave it running and put a big message on the screen, something like this:
I removed libpostexec.so functionality and modified the man pages:
07384ab64aI'll do some testing over the weekend, probably there is more to come.
@netblue30 commented on GitHub (Sep 1, 2018):
OK, this is another bug: default profiles are not applied by default for --chroot. Fix in
ba2e5f55ed@reinerh commented on GitHub (Sep 1, 2018):
Hm, I still think that firejail should not allow the program to run if the user explicitely requests for syscalls to be dropped (on the command line), but for some reason (also using
--chroot) firejail would have to use the default seccomp filter (which would allow again the syscall that was requested to be dropped).Maybe
--seccomp.dropetc should be disallowed from using together with--chroot.@netblue30 commented on GitHub (Sep 3, 2018):
Done! (
55cd5c1d8f)I'll be doing more testing and cleanup this week. This is what I have for chroot in this moment:
if seccomp.drop, seccomp.keep or seccomp= is configured on command line we don't start the sandbox
if seccomp.drop, seccomp,keep or seccomp= is configured in a profile file, we replace the filter, print a big warning on the screen, and start the sandbox
protocol, seccomp.block-secondary and memory-deny-write-execute are handled independently and are not affected
Similar scheme is in effect for caps command line options under chroot.