[GH-ISSUE #3654] Firejail crashing with SELinux support enabled #2301

Closed
opened 2026-05-05 08:59:28 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @reinerh on GitHub (Oct 6, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3654

I just noticed that firejail is crashing on start when firejail has SELinux labeling support enabled (and SELinux support is disabled on the system):

$ gdb src/firejail/firejail core
...
Reading symbols from src/firejail/firejail...
[New LWP 1]
[New LWP 431819]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./src/firejail/firejail'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  selabel_lookup_common (rec=0x0, translating=0, key=0x5578fbf95729 "/root", type=16832) at label.c:167
167	label.c: No such file or directory.
[Current thread is 1 (LWP 1)]
(gdb) bt
#0  selabel_lookup_common (rec=0x0, translating=0, key=0x5578fbf95729 "/root", type=16832) at label.c:167
#1  0x00007f7255a15aeb in selabel_lookup_raw (rec=<optimized out>, con=con@entry=0x5578fc0b69e8 <child_stack+1046696>, key=key@entry=0x5578fbf95729 "/root", type=<optimized out>) at label.c:256
#2  0x00005578fbf85e4d in selinux_relabel_path (path=path@entry=0x5578fbf95729 "/root", inside_path=inside_path@entry=0x5578fbf95729 "/root") at selinux.c:59
#3  0x00005578fbf66dc2 in fs_private () at fs_home.c:360
#4  0x00005578fbf83c82 in sandbox (sandbox_arg=<optimized out>) at sandbox.c:865
#5  0x00007f725593eeaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Originally created by @reinerh on GitHub (Oct 6, 2020). Original GitHub issue: https://github.com/netblue30/firejail/issues/3654 I just noticed that firejail is crashing on start when firejail has SELinux labeling support enabled (and SELinux support is disabled on the system): ``` $ gdb src/firejail/firejail core ... Reading symbols from src/firejail/firejail... [New LWP 1] [New LWP 431819] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `./src/firejail/firejail'. Program terminated with signal SIGSEGV, Segmentation fault. #0 selabel_lookup_common (rec=0x0, translating=0, key=0x5578fbf95729 "/root", type=16832) at label.c:167 167 label.c: No such file or directory. [Current thread is 1 (LWP 1)] (gdb) bt #0 selabel_lookup_common (rec=0x0, translating=0, key=0x5578fbf95729 "/root", type=16832) at label.c:167 #1 0x00007f7255a15aeb in selabel_lookup_raw (rec=<optimized out>, con=con@entry=0x5578fc0b69e8 <child_stack+1046696>, key=key@entry=0x5578fbf95729 "/root", type=<optimized out>) at label.c:256 #2 0x00005578fbf85e4d in selinux_relabel_path (path=path@entry=0x5578fbf95729 "/root", inside_path=inside_path@entry=0x5578fbf95729 "/root") at selinux.c:59 #3 0x00005578fbf66dc2 in fs_private () at fs_home.c:360 #4 0x00005578fbf83c82 in sandbox (sandbox_arg=<optimized out>) at sandbox.c:865 #5 0x00007f725593eeaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ```
gitea-mirror 2026-05-05 08:59:28 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@rusty-snake commented on GitHub (Oct 6, 2020):

WFM Fedora 32 SELinux enabled

<!-- gh-comment-id:704332378 --> @rusty-snake commented on GitHub (Oct 6, 2020): WFM Fedora 32 SELinux enabled
Author
Owner

@reinerh commented on GitHub (Oct 6, 2020):

I think in Fedora SELinux is active by default?
In Debian it's disabled (as AppArmor is enabled by default).

<!-- gh-comment-id:704333476 --> @reinerh commented on GitHub (Oct 6, 2020): I think in Fedora SELinux is active by default? In Debian it's disabled (as AppArmor is enabled by default).
Author
Owner

@topimiettinen commented on GitHub (Oct 6, 2020):

Everything seems to work here with Debian bullseye/sid and SELinux in enforcing mode, Firejail just updated and installed from mkdeb. Do you see something weird if you run ausearch -ts boot | audit2allow?

<!-- gh-comment-id:704344245 --> @topimiettinen commented on GitHub (Oct 6, 2020): Everything seems to work here with Debian bullseye/sid and SELinux in enforcing mode, Firejail just updated and installed from mkdeb. Do you see something weird if you run `ausearch -ts boot | audit2allow`?
Author
Owner

@reinerh commented on GitHub (Oct 6, 2020):

@topimiettinen I don't have SELinux enabled on my system. With enabled I mean that firejail itself has SELinux support (which is a new feature in 0.9.64).
I don't even have ausearch/audit2allow installed. :-)

I think it only crashes on systems where SELinux is disabled (but support in firejail is enabled).

<!-- gh-comment-id:704345728 --> @reinerh commented on GitHub (Oct 6, 2020): @topimiettinen I don't have SELinux enabled on my system. With enabled I mean that firejail itself has SELinux support (which is a new feature in 0.9.64). I don't even have ausearch/audit2allow installed. :-) I think it only crashes on systems where SELinux is disabled (but support in firejail is enabled).
Author
Owner

@topimiettinen commented on GitHub (Oct 6, 2020):

I tested with SELinux disabled but still Firejail started fine. But if your commit fixes the issue on your system, perhaps the problem needed also that there is no SELinux policy, and that would make getting a label fail.

<!-- gh-comment-id:704416268 --> @topimiettinen commented on GitHub (Oct 6, 2020): I tested with SELinux disabled but still Firejail started fine. But if your commit fixes the issue on your system, perhaps the problem needed also that there is no SELinux policy, and that would make getting a label fail.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#2301
No description provided.