mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4728] firefox: webcam and 2fa keys connected after starting don't work #2766
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#2766
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 @WhyNotHugo on GitHub (Nov 30, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4728
Description
Any webcam or 2fa key connected after starting firefox won't work unless I restart it.
Steps to Reproduce
firefoxwith the supplied profileExpected behavior
The connected webcam should show up
Actual behavior
The connected webcm does not show up.
Behavior without a profile
What changed calling
LC_ALL=C firejail --noprofile /path/to/programin a terminal?Additional context
Since this happens for both webcams and 2fa keys, I'm guessing it's related to how
/devis mounted...?Environment
Checklist
/usr/bin/vlc) "fixes" it).https://github.com/netblue30/firejail/issues/1139)browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.Log
No relevant details in logs.
@rusty-snake commented on GitHub (Nov 30, 2021):
Add
ignore private-devif you need to plug-in devices while the sandbox is running.I'm sure they do in firejail 0.9.66 if you allowed them.
@WhyNotHugo commented on GitHub (Nov 30, 2021):
They only work if I connect them before starting firefox.
@rusty-snake commented on GitHub (Nov 30, 2021):
Can you then try to find out which command is breaking it.
@WhyNotHugo commented on GitHub (Nov 30, 2021):
ignore private-devmakes the u2f key kinda work.If I plug it in after the browser prompts me, it's not picked up, but if I cancel the prompt and retry, it works.
@rusty-snake commented on GitHub (Nov 30, 2021):
Does this work w/o firejail?
a67bb37b0d/etc/profile-a-l/firefox-common.profile (L54)@WhyNotHugo commented on GitHub (Nov 30, 2021):
I added
ignore nou2f, but I'm now realising that I needignore private-devtoo, thanks.Yes, the exact steps are:
With firejail, the device won't work until I cancel the prompt and retry.
Without firejail, it works right away.
@WhyNotHugo commented on GitHub (Sep 17, 2022):
Any further suggestions here?
@WhyNotHugo commented on GitHub (Sep 17, 2022):
If I understand correctly, individual devices are bind-mounted into the sandbox's filesystem tree, right?
Is it possible that Firefox isn't receiving some event when the device is connected? Or that the event notifying it of a new device arrives before the bind-mount happens?
I'm not sure how to debug this TBH.
@kmk3 commented on GitHub (Sep 18, 2022):
@WhyNotHugo commented on Sep 17:
When using
private-dev, this is roughly what happens AFAIK:dummydev
This means that the paths inside dummydev are fixed as of when the target
program is started, as the real /dev (and thus any new device that would appear
in it) is not visible anymore. There is no way to keep bind-mounting more
paths, as the privileges will have already been dropped and firejail will have
finished running by the time the target program is executed.
So I don't see how bind-mounting new devices into the sandbox could work
without having something like a privileged daemon running in the background.
Currently, the alternative would be to only blacklist paths in /dev, as the
original /dev would still be used in this case (that is, no dummydev bind
mount). Though note that in this case firejail cannot block any new devices
that show up. For example,
nou2fwould be unable to blacklist any U2F keysthat show up after the sandbox was started.
Note: The steps in the list above are likely similar for the other
private-commands and for
whitelist.Note2: The actual dummydev path is something like /run/firejail/mnt/dev; see
rundefs.h.
@WhyNotHugo commented on GitHub (Sep 18, 2022):
But the device does show up -- if I cancel the u2f prompt on firefox and retry, it does work.
So this works both with and without firejail:
But this only works without firejail:
@kmk3 commented on GitHub (Sep 18, 2022):
@WhyNotHugo commented on Sep 18:
Was firejail started before or after step 1?
Was firejail started before or after step 0?
Does it work with firejail without
private-dev?If so, then my previous comment applies.
If not, then how does Firefox access the device? Examples: Raw access in /dev,
authentication service/socket, dbus.
Does it show up in /dev inside the sandbox? This can be tested in a separate
shell instance with
firejail --join.@kmk3 commented on GitHub (Sep 18, 2022):
@WhyNotHugo commented on Sep 17:
@WhyNotHugo commented on Nov 30, 2021:
Following the template would be a start.
If it works without a profile, then try commenting parts of the profiles being
used to find out which commands are causing the issue.
If not and if the issue is being caused by the lack of access to a path, then
the following might help find it:
firejail --build firefoxThis builds a profile based on which paths Firefox accesses (among other
things) and prints it to stdout.
@rusty-snake commented on GitHub (Sep 18, 2022):
Remember that devices have not only the API provided by dev-nodes in
/devwith open,write,read,ioctl,... but also one in/sysand APIs provided by udev and similar wrappers.