[GH-ISSUE #2989] k3b needs access to /usr/bin/cdrecord #1870

Closed
opened 2026-05-05 08:32:22 -06:00 by gitea-mirror · 13 comments
Owner

Originally created by @bobafetthotmail on GitHub (Oct 5, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2989

and if I try whitelisting this path in k3b.inc I get "invalid whitelist path".
Also if I add a noblacklist line with same path before the whitelist line

k3b
Reading profile /etc/firejail/k3b.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Parent pid 6466, child pid 6467
Error: invalid whitelist path /usr/bin/cdrecord
Error: proc 6466 cannot sync with peer: unexpected EOF
Peer 6467 unexpectedly exited with status 1
Originally created by @bobafetthotmail on GitHub (Oct 5, 2019). Original GitHub issue: https://github.com/netblue30/firejail/issues/2989 and if I try whitelisting this path in k3b.inc I get "invalid whitelist path". Also if I add a noblacklist line with same path before the whitelist line ``` k3b Reading profile /etc/firejail/k3b.profile Reading profile /etc/firejail/disable-common.inc Reading profile /etc/firejail/disable-devel.inc Reading profile /etc/firejail/disable-interpreters.inc Reading profile /etc/firejail/disable-passwdmgr.inc Reading profile /etc/firejail/disable-programs.inc Reading profile /etc/firejail/disable-xdg.inc Reading profile /etc/firejail/whitelist-var-common.inc Parent pid 6466, child pid 6467 Error: invalid whitelist path /usr/bin/cdrecord Error: proc 6466 cannot sync with peer: unexpected EOF Peer 6467 unexpectedly exited with status 1 ```
Author
Owner

@Vincent43 commented on GitHub (Oct 5, 2019):

For /usr/bin/ paths you don't use whitelist but private-bin option however k3b profile doesn't restrict acces to /usr/bin so the problem is somewhere else. IIRC cdrecord may be installed as setuid binary so lack of privileges inside sandbox may be the problem.

<!-- gh-comment-id:538637030 --> @Vincent43 commented on GitHub (Oct 5, 2019): For `/usr/bin/` paths you don't use whitelist but `private-bin` option however [k3b profile](https://github.com/netblue30/firejail/blob/master/etc/k3b.profile) doesn't restrict acces to /usr/bin so the problem is somewhere else. IIRC `cdrecord` may be installed as setuid binary so lack of privileges inside sandbox may be the problem.
Author
Owner

@bobafetthotmail commented on GitHub (Oct 5, 2019):

cdrecord does not seem to have setuid set

sudo ls -l /usr/bin/cdrecord
[sudo] password for root: 
-rwxr-xr-x 1 root root 400848 24 ago 14.00 /usr/bin/cdrecord
<!-- gh-comment-id:538637750 --> @bobafetthotmail commented on GitHub (Oct 5, 2019): cdrecord does not seem to have setuid set ``` sudo ls -l /usr/bin/cdrecord [sudo] password for root: -rwxr-xr-x 1 root root 400848 24 ago 14.00 /usr/bin/cdrecord ```
Author
Owner

@rusty-snake commented on GitHub (Oct 5, 2019):

Maybe capabilities. Can you try firejail --profile=k3b bash and then try if cdrecord can be executed.

<!-- gh-comment-id:538640390 --> @rusty-snake commented on GitHub (Oct 5, 2019): Maybe capabilities. Can you try `firejail --profile=k3b bash` and then try if cdrecord can be executed.
Author
Owner

@bobafetthotmail commented on GitHub (Oct 5, 2019):

No it cannot be executed. I show the ls -l too here

alby@openSUSE-xeon:~> firejail --profile=k3b bash 
Reading profile /etc/firejail/k3b.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Parent pid 28668, child pid 28669
Blacklist violations are logged to syslog
Warning: cleaning all supplementary groups
Child process initialized in 146.10 ms
alby@openSUSE-xeon:~> cdrecord
bash: /usr/bin/cdrecord: Operation not permitted
alby@openSUSE-xeon:~> ls -l /usr/bin/cdrecord 
-rwxr-xr-x 1 nobody nogroup 400848 24 ago 14.00 /usr/bin/cdrecord
<!-- gh-comment-id:538660784 --> @bobafetthotmail commented on GitHub (Oct 5, 2019): No it cannot be executed. I show the `ls -l` too here ``` alby@openSUSE-xeon:~> firejail --profile=k3b bash Reading profile /etc/firejail/k3b.profile Reading profile /etc/firejail/disable-common.inc Reading profile /etc/firejail/disable-devel.inc Reading profile /etc/firejail/disable-interpreters.inc Reading profile /etc/firejail/disable-passwdmgr.inc Reading profile /etc/firejail/disable-programs.inc Reading profile /etc/firejail/disable-xdg.inc Reading profile /etc/firejail/whitelist-var-common.inc Parent pid 28668, child pid 28669 Blacklist violations are logged to syslog Warning: cleaning all supplementary groups Child process initialized in 146.10 ms alby@openSUSE-xeon:~> cdrecord bash: /usr/bin/cdrecord: Operation not permitted alby@openSUSE-xeon:~> ls -l /usr/bin/cdrecord -rwxr-xr-x 1 nobody nogroup 400848 24 ago 14.00 /usr/bin/cdrecord ```
Author
Owner

@Vincent43 commented on GitHub (Oct 5, 2019):

Could you post getcap /usr/bin/cdrecord output?

<!-- gh-comment-id:538667703 --> @Vincent43 commented on GitHub (Oct 5, 2019): Could you post `getcap /usr/bin/cdrecord` output?
Author
Owner

@bobafetthotmail commented on GitHub (Oct 5, 2019):

sudo getcap /usr/bin/cdrecord
[sudo] password for root: 
/usr/bin/cdrecord = cap_ipc_lock,cap_sys_rawio,cap_sys_nice,cap_sys_resource+ep
<!-- gh-comment-id:538689538 --> @bobafetthotmail commented on GitHub (Oct 5, 2019): ``` sudo getcap /usr/bin/cdrecord [sudo] password for root: /usr/bin/cdrecord = cap_ipc_lock,cap_sys_rawio,cap_sys_nice,cap_sys_resource+ep ```
Author
Owner

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

Try replacing caps.drop all with

caps.keep ipc_lock,sys_rawio,sys_nice,sys_resource

possibly the list can be shortened.

<!-- gh-comment-id:538719196 --> @rusty-snake commented on GitHub (Oct 6, 2019): Try replacing `caps.drop all` with ``` caps.keep ipc_lock,sys_rawio,sys_nice,sys_resource ``` possibly the list can be shortened.
Author
Owner

@rusty-snake commented on GitHub (Nov 10, 2019):

@bobafetthotmail
I'm closing here due to inactivity, please fell free to reopen if you still have this issue.

<!-- gh-comment-id:552182778 --> @rusty-snake commented on GitHub (Nov 10, 2019): @bobafetthotmail I'm closing here due to inactivity, please fell free to reopen if you still have this issue.
Author
Owner

@Vincent43 commented on GitHub (Nov 11, 2019):

@rusty-snake I think even without feedback we should try to fix k3b profile, at least with rule you proposed.

<!-- gh-comment-id:552550078 --> @Vincent43 commented on GitHub (Nov 11, 2019): @rusty-snake I think even without feedback we should try to fix k3b profile, at least with rule you proposed.
Author
Owner

@smitsohu commented on GitHub (Nov 11, 2019):

Unfortunately I currently cannot test these things, but I wouldn't be surprised if Brasero had similar problem.

<!-- gh-comment-id:552565362 --> @smitsohu commented on GitHub (Nov 11, 2019): Unfortunately I currently cannot test these things, but I wouldn't be surprised if Brasero had similar problem.
Author
Owner

@rusty-snake commented on GitHub (Dec 14, 2019):

Brasero works with firejail master.

<!-- gh-comment-id:565739717 --> @rusty-snake commented on GitHub (Dec 14, 2019): Brasero works with firejail master.
Author
Owner

@Vincent43 commented on GitHub (Dec 15, 2019):

As there is no feedback from reporter let's consider this one fixed and re-open when someone found otherwise.

<!-- gh-comment-id:565832860 --> @Vincent43 commented on GitHub (Dec 15, 2019): As there is no feedback from reporter let's consider this one fixed and re-open when someone found otherwise.
Author
Owner

@CodeArtisan00 commented on GitHub (Feb 28, 2021):

caps.keep chown,dac_override,ipc_lock,net_bind_service,sys_admin,sys_nice,sys_rawio,sys_resource -tested on Arch Linux.

net_bind_service is odd one for me. I don't know why this one is needed.

<!-- gh-comment-id:787502021 --> @CodeArtisan00 commented on GitHub (Feb 28, 2021): `caps.keep chown,dac_override,ipc_lock,net_bind_service,sys_admin,sys_nice,sys_rawio,sys_resource` -tested on `Arch Linux`. `net_bind_service` is odd one for me. I don't know why this one is needed.
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#1870
No description provided.