Hi.

I happen to also be affected by this bug and managed to narrow it down.

I guess the problem lies in the function sync_initial_tokens_from_driver 
(https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/blob/master/plugins/smartcard/gsd-smartcard-manager.c#L461).
The code assumes that gck_slot_get_token_info won't return NULL.

However looking in gck, it does return NULL if C_GetTokenInfo returns an
error (https://gitlab.gnome.org/GNOME/gcr/-/blob/master/gck/gck-
slot.c#L688).


And this is precisely the behavior of opensc-pkcs11.so when it sees an 
unrecognized token. It returns the token in C_GetSlotList (as present), but 
returns an error when calling C_GetTokenInfo.

So if you login as a user with your USB token plugged in, gsd-smartcard
will crash in a loop.

** Changed in: gnome-settings-daemon (Ubuntu)
       Status: Expired => Incomplete

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-settings-daemon in Ubuntu.
https://bugs.launchpad.net/bugs/2016914

Title:
  gsd-smartcard: segfault on startup

Status in gnome-settings-daemon package in Ubuntu:
  Incomplete

Bug description:
  A smartcard reader attached to the computer on startup, containing a
  non-standard smartcard (in this case an NXP AV3 SAM card) causes gsd-
  smartcard to segfault and restart 200 times after login.

  
  System Info:
  This is Ubuntu 22.04.2 LTS at Kernel 5.19.0-38-generic
  The Smart Card reader is an Identiv uTrust 4711 F with both SAM and 
Contactless slots
  The system is an HP ZBook Firefly 14 G7

  Detailed issue:
  When the smartcard reader is plugged into the system, and an NXP SAM AV3 card 
is inserted into the physical smartcard slot, upon login several (5) Ubuntu 
Error report windows will open asking to report a crash. The reader lights will 
flicker for about 5 minutes until they finally stop. No other issues are seen 
with the system during this time.

  Upon looking at /var/log/syslog, the errors listed in the attachment
  are visible as it appears gsd-smartcard is in a loop of restarting and
  crashing following an error.

  /var/crash contains two files from the crash loop,
  _usr_libexec_gsd_smartcard.1000.crash and
  _usr_libexec_gsd_smartcard_127.crash

  Eventually the crashes seem to stop and the light stops flickering,
  but a logout and log back in will restart the issue again, as will
  rebooting the machine. Re-plugging the device while logged in does not
  seem to cause it to start the crash loop again.

  To complete the standard questions:
  1. I logged into my computer and saw error messages
  2. I expected the smart card to be ignored if there was a card inserted that 
was unexpected or incompatible with the gnome settings daemon
  3. I encountered several crash reporter messages upon logging in, which seem 
to have come from the gsd-smartcard program

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/2016914/+subscriptions


-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to