RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 974096 - Kerberos ticket forwarding does not work if /tmp is polyinstantiated
Summary: Kerberos ticket forwarding does not work if /tmp is polyinstantiated
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openssh
Version: 6.4
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: Lukas "krteknet" Novy
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-13 12:15 UTC by Jan Pazdziora
Modified: 2014-02-18 23:56 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If the /tmp directory of the target user was polyinstantiated, no credentials cache was found on the remote machine. Fix: The cache is now recreated in a new /tmp after pam session is initiated.
Clone Of:
: 1083495 (view as bug list)
Environment:
Last Closed: 2013-11-21 09:46:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
fixed openssh-5.3p1-gsskex.patch (90.35 KB, patch)
2013-06-13 13:00 UTC, Petr Lautrbach
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1591 0 normal SHIPPED_LIVE Low: openssh security, bug fix, and enhancement update 2013-11-20 21:39:30 UTC

Description Jan Pazdziora 2013-06-13 12:15:59 UTC
Description of problem:

If the /tmp directory of the target user is polyinstantiated, even if

  klist -f

reports the ticket is forwardable and

  GSSAPIDelegateCredentials yes
  GSSAPIAuthentication yes

is enabled and ssh -v will report

  debug1: Authentication succeeded (gssapi-with-mic).

running klist on the remote machine will say

  klist: No credentials cache found (ticket cache FILE:/tmp/krb5cc_501_nPsAJ11386)

The issue was first observed when setting up OpenShift Enterprise with IPA.

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

openssh-server-5.3p1-84.1.el6.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. Have remote system with pam_namespace configured to polyinstantiate /tmp.
2. Have the system accept GSSAPI authentication -- the easiest way is to ipa-client-install both the remote and local system to some IPA server.
3. kinit and verify that you have forwardable ticket.
4. ssh to the remote system as a user for whom /tmp gets polyinstantiated (typically not root).
5. Run klist to see your ticket forwarded.

Actual results:

klist: No credentials cache found (ticket cache FILE:/tmp/krb5cc_501_nPsAJ11386)

Expected results:

Ticket cache: FILE:/tmp/krb5cc_501_ojsOB12112
Default principal: 51b6e6e0cd9a28d6fb000006

Valid starting     Expires            Service principal
06/13/13 07:54:16  06/14/13 07:52:15  krbtgt/TESTRELM.COM

Additional info:

If you check the /tmp/krb5cc_501_nPsAJ11386 in your remote user's session, it won't exist. If you check it in remote root's session, it will actually exist.

The problem seems to stem from the fact that the Kerberos cache file gets created before the /tmp gets polyinstantiated, so in user's bash, it cannot be accessed.

This bugzilla limits the possibility of OpenShift Enterprise and Identity Management integration.

Comment 1 Petr Lautrbach 2013-06-13 13:00:11 UTC
Created attachment 760670 [details]
fixed openssh-5.3p1-gsskex.patch

It's possible to store krb5 credentials after a pam session is created. This patch changes the order. Instead of ssh_gssapi_storecreds(); ssh_selinux_setup_exec_context(); do_pam_session() it has moved ssh_gssapi_storecreds(); to the end of chain.

Comment 12 Petr Lautrbach 2013-07-31 15:22:31 UTC
There's a possible workaround using pam_exec which could be set to wrap up pam_namespace in the pam configuration. A script could copy the cache out of /tmp before pam_namespace is run, and copy back the cache after pam namespace set a new /tmp. Something similar to:

snip pam config:

session     optional      pam_exec.so /etc/security/namespace.d/kerberos
session     required      pam_namespace.so
session     optional      pam_exec.so /etc/security/namespace.d/kerberos 1


# cat /etc/security/namespace.d/kerberos
#!/bin/bash

if [ -z "$KRB5CCNAME" ]; then
        exit 0
fi

CCNAME=${KRB5CCNAME#FILE:}

if [ ${CCNAME#/tmp} == ${CCNAME} ]; then
        exit 0
fi

if [ $# -eq 0 ]; then
        tar cvf /var/tmp/krbcc/${CCNAME//\//-}.tar $CCNAME
        rm -rf ${CCNAME}
        exit 0
fi

if [ $# -eq 1 ]; then
        tar -C / -x -v -p -f /var/tmp/krbcc/${CCNAME//\//-}.tar
        rm /var/tmp/krbcc/${CCNAME//\//-}.tar
        exit 0
fi

Comment 13 Petr Lautrbach 2013-08-14 14:35:06 UTC
An update pushed with a fix based on https://bugzilla.redhat.com/show_bug.cgi?id=987792#c6 suggestion

Comment 16 errata-xmlrpc 2013-11-21 09:46:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-1591.html


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