Bug 428439

Summary: sshd segfaults during kerberos auth with krb4 credentials
Product: Red Hat Enterprise Linux 4 Reporter: Adam Stokes <astokes>
Component: pam_krb5Assignee: Nalin Dahyabhai <nalin>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.8CC: tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0712 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-24 19:55:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
pass v4_get_creds correct ctx none

Description Adam Stokes 2008-01-11 15:38:43 UTC
Description of problem:
Customer is always getting a segmentation fault whenever trying to authenticate
on  a sshd server with pam_krb5 configured to convert Krb5 credentials to Krb4.
This was a new feature added on request of this very customer with BZ#201265.

An uninitialized variable could be passed down the stack, after a quick chat
with the package maintainer (nalin) I have written the attached patch
"pam_krb5-2.1.17-1.navid_uninit_ctx.diff" which appears to solve the issue for
the customer.

Version-Release number of selected component (if applicable):
pam_krb5-2.1.17

How reproducible:
100%

Steps to Reproduce:
1. on the ssh server, edited /etc/krb5.conf and added:

[appdefaults]
pam = {
 krb4_convert = true
 external = sshd
}

2. on the ssh client, edited /etc/ssh/ssh_config and added:

GSSAPIDelegateCredentials=yes

3. Update pam system-auth to do the krb4 conversion
  
Actual results:
Connection is closed since sshd dies after successful authentication:
ssh(1562) debug1: Authentications that can continue:
publickey,gssapi-with-mic,password
ssh(1562) debug1: Next authentication method: gssapi-with-mic
ssh(1562) debug1: Delegating credentials
ssh(1562) debug1: Delegating credentials
ssh(1562) debug1: Authentication succeeded (gssapi-with-mic).
ssh(1562) debug1: channel 0: new [client-session]
ssh(1562) debug1: Entering interactive session.
ssh(1562) debug1: channel 0: free: client-session, nchannels 1
Connection to refrh4es-i386 closed by remote host.
Connection to refrh4es-i386 closed.
ssh(1562) debug1: Transferred: stdin 0, stdout 0, stderr 89 bytes in 0.2 seconds


Server-side:
debug3: mm_share_sync: Share sync
debug3: mm_share_sync: Share sync end
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: restore_uid: 0/0
debug1: PAM: establishing credentials
debug3: PAM: opening session
Segmentation fault (core dumped)

Expected results:
sshd stays alive and authentication succeeds or sshd fails gracefully

Additional info:

Comment 1 Adam Stokes 2008-01-11 15:38:44 UTC
Created attachment 291399 [details]
pass v4_get_creds correct ctx

Comment 2 RHEL Program Management 2008-01-11 15:45:42 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 8 errata-xmlrpc 2008-07-24 19:55:05 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0712.html