Bug 1025723 - gnome-keyring: does not properly kill gnome-keyring-daemon before exit, race condition causes pam umount fail
gnome-keyring: does not properly kill gnome-keyring-daemon before exit, race ...
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
: Security
Depends On: 1025724 1030671
Blocks: 1025725
  Show dependency treegraph
Reported: 2013-11-01 07:38 EDT by Ratul Gupta
Modified: 2015-03-03 13:55 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-03-03 13:55:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ratul Gupta 2013-11-01 07:38:42 EDT
Gnome-keyring is found to have a flaw, where an encrypted disk fails to unmount even after logging out using the pam-mount, and as it's in the background, the user won't be aware of this.

The issue is that in pam/gkr-pam-module.c stop_daemon() sends SIGTERM to the gnome-keyring-daemon process instead of SIGKILL i.e. just requesting shutdown and ensuring the process is killed. This means that when pam_gnome_keyring.so returns from pam_close_session() the daemon is sometimes still running (race condition). Since the daemon has an open socket in the users home directory, pam_mount's umount call will fail. It was found that gnome-keyring-daemon has an open socket at in ~/.cache/keyring-xxxxxx/control, which is started at login.

This issue was reported to be successful under lightdm and XFCE, but should also affect other systems that use pam-gnome-keyring and pam-mount together.

A workaround is posted to replace SIGTERM with SIGKILL in the source. You may want to use SIGTERM/sleep/if(alive) SIGKILL to give the daemon a chance to exit properly.

Comment 1 Ratul Gupta 2013-11-01 07:40:05 EDT
Created gnome-keyring tracking bugs for this issue:

Affects: fedora-all [bug 1025724]
Comment 3 Stef Walter 2013-12-10 14:47:39 EST
When you see this condition, could you do a backtrace of all threads in the gnome-keyring-daemon? gnome-keyring-daemon should exit on SIGTERM. If it doesn't, then that's the bug.
Comment 5 Matthias Clasen 2014-01-27 13:40:09 EST
Is there somebody else who can answer Stef's question ?
Comment 6 Vincent Danen 2014-02-05 23:17:33 EST
I've not reproduced this and the individual who filed the bug is no longer with Red Hat.

Unfortunately, I am unable to test this being relatively unfamiliar with the program.  I would have hoped that upstream would have looked into this a bit, but it seems like their bug has not progressed.

Maybe the owner of this package could take some time and look at it?  I'm not sure whether this was actually ever tested, or was simply reported this way.

As an aside, nothing has moved on the Debian report so maybe this is a bogus report?  I'm not sure if anyone has reproduced it or not.
Comment 7 Stef Walter 2014-03-06 12:46:32 EST
Related bug: https://bugzilla.gnome.org/show_bug.cgi?id=708765

Not sure it's the same issue. Patched upstream.

Note You need to log in before you can comment on or make changes to this bug.