[GH-ISSUE #2872] /dev/fd symlink is missing when using private-dev #1792

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

Originally created by @simonfxr on GitHub (Jul 26, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2872

When enabling private-dev a symlink from /dev/fd -> /proc/self/fd is missing. It might be a good idea to just create it, e.g. bash uses it for process substitution.

Originally created by @simonfxr on GitHub (Jul 26, 2019). Original GitHub issue: https://github.com/netblue30/firejail/issues/2872 When enabling `private-dev` a symlink from `/dev/fd` -> `/proc/self/fd` is missing. It might be a good idea to just create it, e.g. bash uses it for process substitution.
gitea-mirror 2026-05-05 08:27:58 -06:00
Author
Owner

@Vincent43 commented on GitHub (Jul 26, 2019):

We may consider re-examining private-dev contents in general. For example here's the difference between content exposed by firejail vs flatpak:

$ firejail --noprofile --private-dev bash
Warning: an existing sandbox was detected. bash will run without any additional sandboxing features
$ ls /dev
dri  full  hidraw0  hidraw1  hidraw2  hidraw3  hidraw4  hidraw5  log  null  ptmx  pts  random  shm  snd  tty  urandom  usb  zero

$ flatpak run org.freedesktop.Platform
[📦 org.freedesktop.Platform ~]$ ls /dev
console  core  fd  full  null  ptmx  pts  random  shm  stderr  stdin  stdout  tty  urandom  zero
<!-- gh-comment-id:515579112 --> @Vincent43 commented on GitHub (Jul 26, 2019): We may consider re-examining `private-dev` contents in general. For example here's the difference between content exposed by firejail vs flatpak: ``` $ firejail --noprofile --private-dev bash Warning: an existing sandbox was detected. bash will run without any additional sandboxing features $ ls /dev dri full hidraw0 hidraw1 hidraw2 hidraw3 hidraw4 hidraw5 log null ptmx pts random shm snd tty urandom usb zero $ flatpak run org.freedesktop.Platform [📦 org.freedesktop.Platform ~]$ ls /dev console core fd full null ptmx pts random shm stderr stdin stdout tty urandom zero ```
Author
Owner

@rusty-snake commented on GitHub (Jul 27, 2019):

stderr, stdin, stdout will also be used in some scripts.

<!-- gh-comment-id:515684973 --> @rusty-snake commented on GitHub (Jul 27, 2019): stderr, stdin, stdout will also be used in some scripts.
Author
Owner

@netblue30 commented on GitHub (Jul 31, 2019):

OK, I'll add /dev/fd,stderr,stdin,stdout. These are symlinks to existing files in /proc.

I'll get rid of /dev/log, it makes sense only for running servers as root. The others are more problematic:

  • /dev/snd is the sound card, mainly used by ALSA - flatpak supports only pulseaudio
  • /dev/dri is the 3D acceleration
  • /dev/hidraw* - human interface device, it could be anything: mouse, keyboard, audio card...
  • /dev/usb - I think it is brought in by the hidraw devices above.
<!-- gh-comment-id:517060075 --> @netblue30 commented on GitHub (Jul 31, 2019): OK, I'll add /dev/fd,stderr,stdin,stdout. These are symlinks to existing files in /proc. I'll get rid of /dev/log, it makes sense only for running servers as root. The others are more problematic: * /dev/snd is the sound card, mainly used by ALSA - flatpak supports only pulseaudio * /dev/dri is the 3D acceleration * /dev/hidraw* - human interface device, it could be anything: mouse, keyboard, audio card... * /dev/usb - I think it is brought in by the hidraw devices above.
Author
Owner

@Vincent43 commented on GitHub (Aug 1, 2019):

To complete above /dev/snd can be removed with --nosound, /dev/dri by --no3d and /dev/hidraw* + /dev/usb by --nou2f.

<!-- gh-comment-id:517224879 --> @Vincent43 commented on GitHub (Aug 1, 2019): To complete above `/dev/snd` can be removed with `--nosound`, `/dev/dri` by `--no3d` and `/dev/hidraw*` + `/dev/usb` by `--nou2f`.
Author
Owner

@smitsohu commented on GitHub (Feb 24, 2020):

The original issue is fixed in f25e8d6846

<!-- gh-comment-id:590448380 --> @smitsohu commented on GitHub (Feb 24, 2020): The original issue is fixed in f25e8d684659eb001407d3eaa58f90671acdd1a9
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#1792
No description provided.