mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #7117] Add a way to fake files in /proc #3492
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#3492
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stanson-ch on GitHub (Mar 29, 2026).
Original GitHub issue: https://github.com/netblue30/firejail/issues/7117
Firefox always trying to eventually eat all memory available. rlimit-as option does not work as expected at all, since, as I understand it limit only single process, not an application as whole, that could spawn hundreds of processes.
But it looks like if you bind a static file where MemTotal set to desired limit with other fields set like memory is nearly exhausted over /proc/meminfo, then Firefox sits within this limit and don't try to eat all memory.
Unfortunately, as I find in previous closed issues here, there is no any plans to allow bind option for firejail started under user, and it is a very bad idea to run Firefox as root even in firejail.
Overall, I want to be able to trick any program running under firejail about any system hardware parameters, say, through special option for faking at least /proc files. Faking /sys could be very useful too. Something like
where .firefox-meminfo is something like
On a machine with, say, 32G RAM
I don't see any security issues in faking any hardware information for a program, and limiting browsers (and potentially other bloatware, say, Electron-based apps) memory appetites looks like a great solution in comparison with buying more and more RAM to satisfy some bloatware that demand more and more with every release.
Or, may be I missed something and there is already a way to fake /proc entry using existing options?
@flingr commented on GitHub (Mar 29, 2026):
Have you tried https://github.com/netblue30/firejail/issues/2896#issuecomment-982643828 yet?
@stanson-ch commented on GitHub (Mar 29, 2026):
Moreover, firejail now is a tool to mitigate undesired behaviour of a program in a modern circumstances when even opensource sofrware become a threat to a privacy and a source of BigData, not even talking about proprietary one. Firejail allow limit or deny access to various parts of filesystem and other environment. Why not take a step forward and make it a tool for creating any completely fake environment, not only allowing or not allowing access to data, but also faking any data to delude untrusted software in all ways possible.
I would also like to see firejail option to set fake system time or provide fake geolocation data to a sandboxed program along with faking files. It is a big step, I know, but I think there will be more and more demand for such features in near future, looking at the path modern software took.
With files it is relatively easy to implement using existing firejail code, all necessary part are already here, with other things more efforts will be needed, but I think it worth a try. I like firejail concept, and ease of use, so I would like to continue to use it, instead of switching to manually created containers with multiple additional tools like
faketimeand others. And something tell me that very soon, say browsers will just deny to start if they find that your XDG_PICTURES_DIR or XDG_DOCUMENTS_DIR is empty or inaccessible, because of IDK, "improving bult-in AI assistant feature user expirience", without a way to disable it, and even for opensource browsers you will need an enormous time and efforts to find and remove this "feature" from source code.