Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1841488

Summary: sshd cannot write into reply cache (/var/tmp/krb5_0.rcache2) due to security context
Product: Red Hat Enterprise Linux 8 Reporter: Filip Dvorak <fdvorak>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.3CC: lvrabec, mmalik, omoris, pasik, plautrba, rharwood, ssekidde
Target Milestone: rcKeywords: Triaged
Target Release: 8.3Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:56:37 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: 1842946    

Description Filip Dvorak 2020-05-29 09:41:06 UTC
I have cloned this bug from this fedora bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1838018

Description of problem:
After the installation of krb5 I added a new user into a krb5 db via the following command "kadmin -p root/admin -w password -q 'ank -pw password alice". The command finished successfully and the reply cache file was created. The problem is that this file had security context: system_u:object_r:kadmind_tmp_t:s0. This is a problem when the ssh via krb5-GSSAPI is used because sshd service cannot write into this file.  

Version-Release number of selected component (if applicable):
krb5-server-1.18.2-2.el8.x86_64

How reproducible:
always

Steps to Reproduce:
1. Install and configure krb5kdc and kadmin

hostnamectl set-hostname kerberos.example.com
sed -i "1i 127.0.0.1 kerberos.example.com" /etc/hosts
echo -ne '[realms]\nEXAMPLE.COM = {\n    kdc = kerberos.example.com\n    admin_server = kerberos.example.com\n}\n\n[domain_realm]\n.example.com = EXAMPLE.COM\nexample.com = example.com\n' > /etc/krb5.conf.d/example_com
sed -i "s/^# default_realm/ default_realm/" /etc/krb5.conf
echo -ne "passwd\npasswd\n" | kdb5_util create -s
systemctl start krb5kdc kadmin
 
2.kadmin.local -r EXAMPLE.COM -q "addprinc -pw passwd root/admin"
3.kadmin.local -r EXAMPLE.COM -q "addprinc -randkey host/fedora.example.com
4.kadmin.local -r EXAMPLE.COM -q "ktadd host/fedora.example.com"
5.kadmin -p root/admin -w password -q 'ank -pw password alice'

Actual results:
# kinit alice
Password for alice: 

ssh alice.com pwd
alice.com's password: 


Expected results:
# kinit alice
Password for alice: 

# ssh alice.com pwd
/home/alice


Additional info:
# ll -Z /var/tmp/krb5_0.rcache2
-rw-------. 1 root root system_u:object_r:kadmind_tmp_t:s0 14656 May 29 05:37 /var/tmp/krb5_0.rcache2

AVC message:
time->Fri May 29 05:31:31 2020
type=AVC msg=audit(1590744691.663:712): avc:  denied  { write } for  pid=21825 comm="sshd" name="krb5_0.rcache2" dev="vda1" ino=9344 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:kadmind_tmp_t:s0 tclass=file permissive=1

Comment 23 errata-xmlrpc 2020-11-04 01:56:37 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 (selinux-policy bug fix and enhancement update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHBA-2020:4528