GNOME Bugzilla – Bug 789208
gnome keyring daemon stuck in an infinite loop in libgcrypt in FIPS mode
Last modified: 2021-06-18 10:40:51 UTC
When a user logs in via gdm on a FIPS-enabled system, gnome keyring daemon gets stuck in an infinite loop, which prevents successful login. Tested with gkd 3.20.0 and libgcrypt 1.8.1. Here's what happens: libgcrypt gets initialized by egg_libgcrypt_initialize(). _gcry_rndlinux_gather_random opens /dev/random and stores the file descriptor to a static variable fd_random. To become a daemon, gnome keyring performs a double fork and later does a descriptor cleanup in redirect_fds_after_fork(), which reopens /dev/null over descriptors 0-2. Descriptor 2 before redirect_fds_after_fork(): # ls -l /proc/10049/fd/2 lr-x------ 1 test users 64 19. říj 17.38 /proc/10049/fd/2 -> /dev/random After: # ls -l /proc/10049/fd/2 lr-x------ 1 test users 64 19. říj 17.38 /proc/10049/fd/2 -> /dev/null libgcrypt however still believes that descriptor 2 points to the random device, so when _gcry_rndlinux_gather_random() is invoked again, it repeatedly read()s 0 byte blocks from the descriptor, creating an infinite loop. Backtrace that leads to _gcry_rndlinux_gather_random() after the second fork():
+ Trace 238079
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-keyring/-/issues/ Thank you for your understanding and your help.