Bug 751892

Summary: SSO: Selinux error prevent login to virtual terminal (CTRL+ALT+F2) with a smart card.
Product: Red Hat Enterprise Linux 6 Reporter: Asha Akkiangady <aakkiang>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: high Docs Contact:
Priority: high    
Version: 6.2CC: benl, ckannan, dwalsh, jmagne, mmalik, nalin, rstrode, ssorce, tmraz
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.7.19-125.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 10:20:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Asha Akkiangady 2011-11-07 23:05:39 UTC
Description of problem:
SSO: Selinux error prevent login to virtual terminal (CTRL+ALT+F2) with a smart card.
Version-Release number of selected component (if applicable):
pam_pkcs11-0.6.2-11.1.el6.x86_64
coolkey-1.1.0-19.el6.x86_64
pam_krb5-2.3.11-9.el6.x86_64
authconfig-6.1.12-5.el6.x86_64

How reproducible:


Steps to Reproduce:
1. Desktop is configured with smart card authentication. User can login to desktop successfully with a smart card.

2. Login to virtual terminal (CTRL + ALT + F2) with the same smart card,  

Terminal display:

Red Hat Enterprise Linux Client release 6.2 Beta (Santiago)
Kernel 2.6.32-216.el6.x86_64 on an x86_64
dhcp231-57 login: aakkiang
Found the Smart card.
Welcome Asha!
Smart card PIN:
ERROR:pam_pkcs11.c:492: verify_certificate() failed:
ERROR:pam_pkcs11.c:544: no valid certificate which meets all requirements found
Login incorrect

Actual results:
Unable to login with selinux policy enforcing.

This selinux error is thrown:

Nov  7 17:51:13 XXXX kernel: type=1400 audit(1320706273.000:15): avc:  denied  { name_connect } for  pid=3986 comm="login" dest=9180 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:object_r:pki_ca_port_t:s0 tclass=tcp_socket


Expected results:
User should be able to login with a smart card.

Additional info:
With selinux in permissive mode login to virtual terminal is successful.

Comment 2 Chandrasekar Kannan 2011-11-07 23:14:30 UTC
this is a regression. requesting blocker+

Comment 3 Miroslav Grepl 2011-11-08 09:47:16 UTC
So, is this working in enforcing mode with

# grep local_login /var/log/audit/audit.log |audit2allow -M mylocallogin
# semodule -i mylocallogin.pp


If this is a regression, in which release did it work?

Comment 4 Tomas Mraz 2011-11-08 10:50:20 UTC
It certainly worked on RHEL-5. I am not sure this worked on RHEL-6.

Comment 5 Asha Akkiangady 2011-11-08 14:51:14 UTC
It worked in RHEL-6.0 and RHEL-6.1 releases.

Comment 6 Daniel Walsh 2011-11-08 17:00:04 UTC
I don't know how, I don't believe we removed this access, and do not see this access in Fedora.  In RHEL5 login programs were not confined.

You can prove me wrong if this returns values on 6.0 or 6.1

sesearch -A -s local_login_t -t pki_ca_port_t -p name_connect -C

Should this port be allowed to all login programs?

Comment 7 Daniel Walsh 2011-11-08 17:01:45 UTC
Will login programs need to connect to any of these ports?

network_port(pki_ca, tcp, 9180, s0, tcp, 9701, s0, tcp, 9443-9447, s0)
network_port(pki_kra, tcp, 10180, s0, tcp, 10701, s0, tcp, 10443-10446, s0)
network_port(pki_ocsp, tcp, 11180, s0, tcp, 11701, s0, tcp, 11443-11446, s0)
network_port(pki_tks, tcp, 13180, s0, tcp, 13701, s0, tcp, 13443-13446, s0)
network_port(pki_ra, tcp,12888-12889,s0)
network_port(pki_tps, tcp,7888-7889,s0)

Comment 8 Tomas Mraz 2011-11-08 17:20:37 UTC
I'd suspect rather change in pam_pkcs11 or pam_krb5 or krb5-libs.

Comment 9 Nalin Dahyabhai 2011-11-08 19:00:38 UTC
I expect that NSS is performing OCSP verification on certificates.  This could get messy, as OCSP-over-HTTP doesn't run on a predefined port (though IIRC Dogtag defaults to a combination of 9180 and 9443).

Comment 11 Miroslav Grepl 2011-11-09 11:05:21 UTC
I am adding a fix.

Comment 12 Daniel Walsh 2011-11-09 13:17:42 UTC
9180 and 9443 are covered by pki_ca

Comment 13 Miroslav Grepl 2011-11-09 15:17:56 UTC
Fixed in selinux-policy-3.7.19-125.el6

Comment 17 Asha Akkiangady 2011-11-11 16:08:14 UTC
Tested with selinux-policy-3.7.19-126.el6, login to virtual terminal (CTRL+ALT+F2) with a smart card is successful. No AVC denied messages.


Marking the bug verified.

Comment 18 errata-xmlrpc 2011-12-06 10:20:49 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/RHBA-2011-1511.html