Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox crashes when smart card is removed #293

Open
ZeiP opened this issue Apr 21, 2020 · 5 comments
Open

Firefox crashes when smart card is removed #293

ZeiP opened this issue Apr 21, 2020 · 5 comments

Comments

@ZeiP
Copy link

ZeiP commented Apr 21, 2020

I'm running Fedora 31. When I insert my Finnish Fineid smart card to the laptop's integrated smart card reader (Bus 001 Device 003: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader) it usually works ok. However, when I remove the smart card from the slot, all the Firefox instances on my computer crash.

The crash report for a single Firefox instance crashing on smart card removal is available at https://crash-stats.mozilla.org/report/index/57f1e3a0-8f88-4a8a-b927-d5ed20200421 . When browsing through the crash report, I noticed that there's a similar bug report for Yubikey removal at https://bugzilla.mozilla.org/show_bug.cgi?id=1612098. The crash signature is a bit different, but the conditions seem quite similar and the actual failing component is apparently p11-kit in both cases.

Let me know if you need any additional information on the crash or if the root cause of the crash doesn't seem to be p11-kit.

@ueno
Copy link
Member

ueno commented Apr 22, 2020

As p11-kit-proxy.so (which is the component loaded by Firefox) merely aggregates the access to multiple smartcard drivers (PKCS#11 modules), the problem can be in the driver as well.

If would be nice if you could collect a meaningful backtrace by installing debuginfo packages (p11-kit and opensc).

@ZeiP
Copy link
Author

ZeiP commented Apr 23, 2020

I'm a bit inexperienced with desktop software development, but I installed the debuginfo packages for p11-kit, opensc and also firefox and got a gdb trace for a browser instance that crashes. Does this help or should I do something differently?
gdb.txt

@samsapti
Copy link

samsapti commented Sep 27, 2021

@ueno @ZeiP

I can confirm that this is still an issue as of today (2021-09-27). For me, the problem occurs on Firefox 92.0 on Fedora 34 when using my YubiKey 5 series (with OpenPGP smartcard functionality). As soon as I insert my YubiKey, tabs start to act strangely, they just keep loading forever and some of them entirely stops loading and the reload button becomes greyed out. When I go into Settings > Privacy & Security > Security Devices and unload p11-kit-proxy, Firefox suddenly starts to work as normal (if it doesn't crash before then). If I unplug my YubiKey without having unloaded the module, Firefox crashes after some time.

This doesn't happen on other distros, such as Artix, where the module inside Firefox' Security Devices menu is called OpenSC instead of p11-kit-proxy.

@samsapti
Copy link

samsapti commented Sep 27, 2021

Here is a gdb trace for Firefox. Appearently, Firefox doesn't crash when I remove my YubiKey, but it acts as described above while it is plugged in. Some time after I unplug my YubiKey, it starts to act normally again.

I have marked some key events inside the file (at approximate locations).

firefox-gdb.log

@jblz
Copy link

jblz commented Nov 7, 2022

Firefox is crashing for me as well when removing a Yubikey series 5 device -- it seems fine while inserted, however, and it works correctly for authentication purposes in Firefox and elsewhere.

As it's not using a mounted filesystem, I'm not given any interface to "eject" the device -- I'm just pulling it out of the slot.

I'm running Fedora 36. Happy to try and get more info if someone can point me in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants