[GH-ISSUE #351] private-dev breaks global /dev/pts mountpoint #247

Closed
opened 2026-05-05 05:24:48 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @stiell on GitHub (Mar 4, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/351

When starting firejail with --private-dev option, the mount options for /dev/pts change globally:

~ $ mount | grep /dev/pts
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
~ $ firejail --noprofile --private-dev
Parent pid 1050, child pid 1051

Child process initialized
~]$ exit

parent is shutting down, bye...
~ $ mount | grep /dev/pts
devpts on /dev/pts type devpts (rw,relatime,mode=600)

This causes e.g. urxvt to fail to start, even if run outside any sandbox:

~ $ urxvt
urxvt: can't initialize pseudo-tty, aborting.

strace urxvt shows:

chown("/dev/pts/42", 1000, 5)           = -1 EPERM (Operation not permitted)

It needs /dev/pts to be mounted with the options gid=5,mode=620, which firejail for some reason has changed. mount -o remount,mode=620,gid=5 /dev/pts reverts the breakage.

This is with firejail 0.9.38 on Gentoo.

Originally created by @stiell on GitHub (Mar 4, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/351 When starting firejail with --private-dev option, the mount options for /dev/pts change globally: ``` ~ $ mount | grep /dev/pts devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620) ~ $ firejail --noprofile --private-dev Parent pid 1050, child pid 1051 Child process initialized ~]$ exit parent is shutting down, bye... ~ $ mount | grep /dev/pts devpts on /dev/pts type devpts (rw,relatime,mode=600) ``` This causes e.g. urxvt to fail to start, even if run outside any sandbox: ``` ~ $ urxvt urxvt: can't initialize pseudo-tty, aborting. ``` `strace urxvt` shows: ``` chown("/dev/pts/42", 1000, 5) = -1 EPERM (Operation not permitted) ``` It needs /dev/pts to be mounted with the options gid=5,mode=620, which firejail for some reason has changed. `mount -o remount,mode=620,gid=5 /dev/pts` reverts the breakage. This is with firejail 0.9.38 on Gentoo.
gitea-mirror 2026-05-05 05:24:48 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@netblue30 commented on GitHub (Mar 5, 2016):

Thanks for the bug, I'll put a fix in soon.

<!-- gh-comment-id:192698215 --> @netblue30 commented on GitHub (Mar 5, 2016): Thanks for the bug, I'll put a fix in soon.
Author
Owner

@netblue30 commented on GitHub (Mar 9, 2016):

I think I have a fix for it. I'll reopen the bug if necessary.

<!-- gh-comment-id:194371564 --> @netblue30 commented on GitHub (Mar 9, 2016): I think I have a fix for it. I'll reopen the bug if necessary.
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#247
No description provided.