Bug 1032154

Summary: gdm calls pam_setcred with PAM_ESTABLISH_CRED instead of PAM_REINITIALIZE_CRED during screen unlock
Product: Red Hat Enterprise Linux 7 Reporter: Nalin Dahyabhai <nalin>
Component: gdmAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED CURRENTRELEASE QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: pvine, stephan.wiesand, vrutkovs
Target Milestone: rcKeywords: OtherQA
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gdm-3.8.4-8.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 09:57:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1029374    

Description Nalin Dahyabhai 2013-11-19 15:56:49 UTC
Description of problem:
When I log in using gdm and gnome-shell and then lock the screen, on unlock gdm is calling pam_setcred with the wrong flag (it uses PAM_ESTABLISH_CRED instead of PAM_REINITIALIZE_CRED).  If a module in the PAM configuration is going to do different things based on that flag, the wrong thing can happen.

Version-Release number of selected component (if applicable):
gdm-3.8.4-7.el7.x86_64
gnome-shell-3.8.4-14.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Use authconfig to enable NIS and Kerberos, which should force the system to use pam_krb5.
2. Add this to your /etc/krb5.conf's [appdefaults] section:
  pam = {
    debug = true
  }
3. Log in, lock the screen, and unlock it.

Actual results:
/var/log/secure will note something like: 
Nov 19 10:38:56 blah gdm-password]: pam_krb5[2258]: pam_setcred(PAM_ESTABLISH_CRED) returning 0 (Success)

Expected results:
/var/log/secure will note something like: 
Nov 19 10:38:56 blah gdm-password]: pam_krb5[2258]: pam_setcred(PAM_REINITIALIZE_CRED) returning 0 (Success)

Additional info:
While this appears to work when the default ccache is configured to a location that doesn't change (so that when the module attempts to create a new ccache, it happens to use the same location that was also used when the user logged in), if you configure it to use a per-session location (say, FILE:/tmp/krb5cc_%{uid}_XXXXXX), it'll create a new ccache every time the user unlocks their screen, and the ccache that the user is actually using won't be updated.

Comment 2 Ray Strode [halfline] 2013-11-20 19:34:10 UTC
i've pushed a fix for this upstream. devack+

Comment 4 Nalin Dahyabhai 2013-11-22 21:09:42 UTC
3.8.4-8.el7 fixes it for me, too.

Comment 5 Stephan Wiesand 2014-01-03 17:21:02 UTC
Any chance you could make the binary rpms available? I'd like to verify that this also fixes the renewal of AFS tokens when the screen is unlocked - right now, pam_krb5 does acquire a fresh token but I think it ends up in a different PAG.

I'd patch and build myself, but 7.0 beta doesn't ship many of the build requirements.

Thanks.

Comment 6 Ray Strode [halfline] 2014-01-06 16:31:10 UTC
Stephan, thank you for doing additional testing.  You can find test builds here:

http://people.redhat.com/rstrode/1032154/src/
http://people.redhat.com/rstrode/1032154/x86_64/

Comment 7 Stephan Wiesand 2014-01-07 10:15:00 UTC
Thanks a lot. I can confirm that with these the AFS token renewal works as expected when the screen is unlocked.

Comment 8 Vadim Rutkovsky 2014-03-24 13:13:32 UTC
Setting the status to Verified per comment #4 and #7

Comment 9 Ludek Smid 2014-06-13 09:57:29 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.