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 1664983 - SELinux prevents kadmind from searching in /var/lib/softhsm directory
Summary: SELinux prevents kadmind from searching in /var/lib/softhsm directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 8.1
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
: 1689921 (view as bug list)
Depends On: 1673107 1682526
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-10 08:16 UTC by Kaleem
Modified: 2020-11-14 12:24 UTC (History)
9 users (show)

Fixed In Version: selinux-policy-3.14.3-6.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-05 22:09:45 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3547 0 None None None 2019-11-05 22:09:56 UTC

Description Kaleem 2019-01-10 08:16:11 UTC
Description of problem:

Following avc denial seen during execution of one of regression test suite.


Version-Release number of selected component (if applicable):
[root@vm-idm-012 ~]# rpm -q selinux-policy ipa-server krb5-server 
selinux-policy-3.14.1-49.el8.noarch
ipa-server-4.7.1-7.module+el8+2555+b334d87b.x86_64
krb5-server-1.16.1-20.el8.x86_64
[root@vm-idm-012 ~]# 

How reproducible:
Always

Steps to Reproduce:
1.
During following test step execution, avc denial seen

:: [ 19:36:42 ] :: [   LOG    ] :: [stage 3] build up password history pool by changing password, the password will pick up from password pool. If password change success, the password will save to history pool for future use, current history pool []
:: [ 19:36:42 ] :: [  BEGIN   ] :: Running 'rlDistroDiff keyctl'
:: [ 19:36:42 ] :: [   PASS   ] :: Command 'rlDistroDiff keyctl' (Expected 0, got 0)
:: [ 19:36:42 ] :: [   LOG    ] :: Running: temp_fix_ccache_through_pam_stack test_user test_user Password_123
:: [ 19:36:43 ] :: [   LOG    ] :: Running: echo Password_123 | sudo -u test_user kinit test_user
Password for test_user: 
:: [ 19:36:44 ] :: [  BEGIN   ] :: verify password [Password_123] for user [test_user] :: actually running 'echo Password_123 | sudo -u test_user kinit test_user 2>&1 >/dev/null'

Actual results:
Following avc denial seen

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      31
selinux-policy-3.14.1-49.el8.noarch
----
time->Wed Jan  9 19:36:42 2019
type=PROCTITLE msg=audit(1547042802.339:3710): proctitle=2F7573722F7362696E2F6B61646D696E64002D50002F7661722F72756E2F6B61646D696E642E706964
type=PATH msg=audit(1547042802.339:3710): item=0 name="/root/.config/pkcs11/pkcs11.conf" nametype=UNKNOWN cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0
type=CWD msg=audit(1547042802.339:3710): cwd="/"
type=SYSCALL msg=audit(1547042802.339:3710): arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=55c205845250 a2=80000 a3=0 items=1 ppid=1 pid=25493 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="kadmind" exe="/usr/sbin/kadmind" subj=system_u:system_r:kadmind_t:s0 key=(null)
type=AVC msg=audit(1547042802.339:3710): avc:  denied  { search } for  pid=25493 comm="kadmind" name=".config" dev="dm-0" ino=67999078 scontext=system_u:system_r:kadmind_t:s0 tcontext=unconfined_u:object_r:config_home_t:s0 tclass=dir permissive=0
----
time->Wed Jan  9 19:36:42 2019
type=PROCTITLE msg=audit(1547042802.340:3711): proctitle=2F7573722F7362696E2F6B61646D696E64002D50002F7661722F72756E2F6B61646D696E642E706964
type=PATH msg=audit(1547042802.340:3711): item=0 name="/root/.config/pkcs11/modules" nametype=UNKNOWN cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0
type=CWD msg=audit(1547042802.340:3711): cwd="/"
type=SYSCALL msg=audit(1547042802.340:3711): arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=55c205845250 a2=90800 a3=0 items=1 ppid=1 pid=25493 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="kadmind" exe="/usr/sbin/kadmind" subj=system_u:system_r:kadmind_t:s0 key=(null)
type=AVC msg=audit(1547042802.340:3711): avc:  denied  { search } for  pid=25493 comm="kadmind" name=".config" dev="dm-0" ino=67999078 scontext=system_u:system_r:kadmind_t:s0 tcontext=unconfined_u:object_r:config_home_t:s0 tclass=dir permissive=0
----
time->Wed Jan  9 19:36:42 2019
type=PROCTITLE msg=audit(1547042802.347:3712): proctitle=2F7573722F7362696E2F6B61646D696E64002D50002F7661722F72756E2F6B61646D696E642E706964
type=PATH msg=audit(1547042802.347:3712): item=0 name="/root/.config/softhsm2/softhsm2.conf" nametype=UNKNOWN cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0
type=CWD msg=audit(1547042802.347:3712): cwd="/"
type=SYSCALL msg=audit(1547042802.347:3712): arch=c000003e syscall=21 success=no exit=-13 a0=7ffc6d0e0500 a1=4 a2=0 a3=0 items=1 ppid=1 pid=25493 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="kadmind" exe="/usr/sbin/kadmind" subj=system_u:system_r:kadmind_t:s0 key=(null)
type=AVC msg=audit(1547042802.347:3712): avc:  denied  { search } for  pid=25493 comm="kadmind" name=".config" dev="dm-0" ino=67999078 scontext=system_u:system_r:kadmind_t:s0 tcontext=unconfined_u:object_r:config_home_t:s0 tclass=dir permissive=0
----
time->Wed Jan  9 19:36:42 2019
type=PROCTITLE msg=audit(1547042802.347:3713): proctitle=2F7573722F7362696E2F6B61646D696E64002D50002F7661722F72756E2F6B61646D696E642E706964
type=PATH msg=audit(1547042802.347:3713): item=0 name="/var/lib/softhsm/tokens/" nametype=UNKNOWN cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0
type=CWD msg=audit(1547042802.347:3713): cwd="/"
type=SYSCALL msg=audit(1547042802.347:3713): arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=55c205793dc0 a2=90800 a3=0 items=1 ppid=1 pid=25493 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="kadmind" exe="/usr/sbin/kadmind" subj=system_u:system_r:kadmind_t:s0 key=(null)
type=AVC msg=audit(1547042802.347:3713): avc:  denied  { search } for  pid=25493 comm="kadmind" name="softhsm" dev="dm-0" ino=101255400 scontext=system_u:system_r:kadmind_t:s0 tcontext=system_u:object_r:named_cache_t:s0 tclass=dir permissive=0



Expected results:
No AVC denial.

Additional info:

Comment 2 Lukas Vrabec 2019-03-18 17:58:41 UTC
*** Bug 1689921 has been marked as a duplicate of this bug. ***

Comment 3 Alexander Bokovoy 2019-03-22 16:21:39 UTC
This is due to p11-kit pulling in softhsm2 module into any application that initializes openssl engines.

Kaleem, could you please try this workaround:

----------------------------------------
# cat /etc/pkcs11/modules/softhsm2.module

module: /usr/lib64/pkcs11/libsofthsm2.so
disable-in: kadmind
----------------------------------------

Nikos, this is another case of p11-kit creating issues with SELinux contexts. There is no way so far to contain pkcs11 accesses. May be we need to integrate p11-kit with SELinux so that module loads are done in a context that can be granted certain access rights?

Comment 6 Kaleem 2019-03-27 15:48:49 UTC
Please try workaround of https://bugzilla.redhat.com/show_bug.cgi?id=1664983#c3

Comment 34 errata-xmlrpc 2019-11-05 22:09:45 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.

https://access.redhat.com/errata/RHBA-2019:3547


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