[GH-ISSUE #1238] default bind mounts and noexec option #841

Closed
opened 2026-05-05 06:57:28 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @SYN-cook on GitHub (Apr 21, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1238

noexec /tmp and noexec ${HOME} don't necessarily block execution completely, I see few folders still allowing it:

  • ~/.config/pulse
  • /tmp/.X11-unix
  • ~/.local/share

Since noexec options are being used in profiles, it would be nice to close loopholes for the standard configuration.

~/.local/share can be easily handled in disable-common.inc. And the .X11-unix and pulse folders should be also safe for remounting with a noexec flag.

Originally created by @SYN-cook on GitHub (Apr 21, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1238 `noexec /tmp` and `noexec ${HOME}` don't necessarily block execution completely, I see few folders still allowing it: - ~/.config/pulse - /tmp/.X11-unix - ~/.local/share Since noexec options are being used in profiles, it would be nice to close loopholes for the standard configuration. ~/.local/share can be easily handled in disable-common.inc. And the .X11-unix and pulse folders should be also safe for remounting with a noexec flag.
gitea-mirror 2026-05-05 06:57:28 -06:00
Author
Owner

@SkewedZeppelin commented on GitHub (Apr 21, 2017):

Why does 'noexec ${HOME}' not apply to ~/.local/share? Also this will break a few profiles such as Steam, which stores itself there.

<!-- gh-comment-id:296221941 --> @SkewedZeppelin commented on GitHub (Apr 21, 2017): Why does 'noexec ${HOME}' not apply to ~/.local/share? Also this will break a few profiles such as Steam, which stores itself there.
Author
Owner

@SYN-cook commented on GitHub (Apr 21, 2017):

@SpotComms Did you try running e.g. findmnt inside the jail? It would be interesting if you can't reproduce it, I have seen it on different systems.

If besides Steam more programs install themselves to ~/.local/share, maybe an alternative implementation could be to tie all remounting works to the noexec options, instead of remounting the folders noexec from the beginning.

<!-- gh-comment-id:296242394 --> @SYN-cook commented on GitHub (Apr 21, 2017): @SpotComms Did you try running e.g. `findmnt` inside the jail? It would be interesting if you can't reproduce it, I have seen it on different systems. If besides Steam more programs install themselves to ~/.local/_share_, maybe an alternative implementation could be to tie all remounting works to the noexec options, instead of remounting the folders noexec from the beginning.
Author
Owner

@SkewedZeppelin commented on GitHub (Apr 21, 2017):

You are correct, I was just wondering why 'noexec ${HOME}' doesn't apply recursively as I assumed it did.

Edit: noexec just does the one directory specified, none of the other directories end up with noexec. That seems pretty useless. @netblue30 please make noexec recursively apply.

<!-- gh-comment-id:296243443 --> @SkewedZeppelin commented on GitHub (Apr 21, 2017): You are correct, I was just wondering why 'noexec ${HOME}' doesn't apply recursively as I assumed it did. ~~Edit: noexec just does the one directory specified, none of the other directories end up with noexec. That seems pretty useless. @netblue30 please make noexec recursively apply.~~
Author
Owner

@SYN-cook commented on GitHub (Apr 21, 2017):

@SpotComms On my current setup (I'm on a trip and unfortunately can't try many things), the noexec option is enforced recursively, except for those three folders mentioned in the first comment.... e.g. I go to a random subfolder and try to run an executable, I am told I don't have permissions to do so.

Is it possible for you to execute programs/scripts in subfolders?

<!-- gh-comment-id:296305437 --> @SYN-cook commented on GitHub (Apr 21, 2017): @SpotComms On my current setup (I'm on a trip and unfortunately can't try many things), the noexec option is enforced recursively, except for those three folders mentioned in the first comment.... e.g. I go to a random subfolder and try to run an executable, I am told I don't have permissions to do so. Is it possible for you to execute programs/scripts in subfolders?
Author
Owner

@SkewedZeppelin commented on GitHub (Apr 21, 2017):

@SYN-cook Okay so while 'findmnt' only shows the 'noexec' option for /home/user and not for any subdirectories, I cannot execute under ~, ~/.config. I can however execute under ~/.local/share. So yes you are again correct. I created #1242 as an alternative solution.

<!-- gh-comment-id:296310069 --> @SkewedZeppelin commented on GitHub (Apr 21, 2017): @SYN-cook Okay so while 'findmnt' only shows the 'noexec' option for /home/user and not for any subdirectories, I cannot execute under ~, ~/.config. I can however execute under ~/.local/share. So yes you are again correct. I created #1242 as an alternative solution.
Author
Owner

@SYN-cook commented on GitHub (Apr 21, 2017):

👍 Cool! So let's see what netblue30 says

<!-- gh-comment-id:296316502 --> @SYN-cook commented on GitHub (Apr 21, 2017): :+1: Cool! So let's see what netblue30 says
Author
Owner

@netblue30 commented on GitHub (Apr 22, 2017):

I'll play a little bit with noexec on ~/.config/pulse and /tmp/.X11-unix and put them disable-common.inc.

<!-- gh-comment-id:296397035 --> @netblue30 commented on GitHub (Apr 22, 2017): I'll play a little bit with noexec on ~/.config/pulse and /tmp/.X11-unix and put them disable-common.inc.
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#841
No description provided.