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 2150357 - Smart Card auth does not work with p11_uri (with-smartcard-required)
Summary: Smart Card auth does not work with p11_uri (with-smartcard-required)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sssd
Version: 8.7
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Sumit Bose
QA Contact: Scott Poore
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-02 16:16 UTC by Marek Havrila
Modified: 2023-05-16 11:12 UTC (History)
6 users (show)

Fixed In Version: sssd-2.8.2-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-16 09:08:11 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
p11_child.log (9.99 KB, text/plain)
2022-12-02 16:23 UTC, Marek Havrila
no flags Details
sssd_pam.log (77.79 KB, text/plain)
2022-12-02 16:23 UTC, Marek Havrila
no flags Details
sssd_shadowutils.log (5.17 KB, text/plain)
2022-12-02 16:24 UTC, Marek Havrila
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 6479 0 None open Smart Card auth does not work with p11_uri (with-smartcard-required) 2022-12-08 15:42:50 UTC
Github SSSD sssd pull 6480 0 None open p11: fix size of argument array 2022-12-08 18:34:40 UTC
Red Hat Issue Tracker RHELPLAN-141208 0 None None None 2022-12-02 16:17:37 UTC
Red Hat Issue Tracker SSSD-5277 0 None None None 2022-12-08 15:13:22 UTC
Red Hat Product Errata RHBA-2023:2986 0 None None None 2023-05-16 09:08:18 UTC

Description Marek Havrila 2022-12-02 16:16:28 UTC
Created attachment 1929393 [details]
screenshot

Description of problem:

It is not possible to login to RHEL when p11-uri is specified in sssd.conf and smart card is required for auth (i.e. authselect profile is 'sssd with-smartcard with-smartcard required'). This applies for GDM as well as console login.

Version-Release number of selected component (if applicable):
RHEL-8.7.0-20221012.5
sssd-2.7.3-4.el8.x86_64

How reproducible:
always

Steps to Reproduce:

1. get fresh system; smart card and reader
2. `useradd testuser`

3. configure system for smart-card auth:
3.1: create sssd.conf file with matchrule for user
3.2: get p11_uri (p11tool --list-tokens) of card and add it to sssd.conf 
3.3: add rootCA.cert to /etc/sssd/pki/sssd_auth_ca_db.pem
3.4:
`chmod 0700 /etc/sssd`
`chmod 0600 /etc/sssd/sssd.conf`
`chmod 0644 /etc/sssd/pki/sssd_auth_ca_db.pem`
`rm -rf /var/lib/sss/{mc,db}/*`
3.5: `systemctl restart sssd`
3.6: `authselect select sssd with-smartcard with-smartcard-required --force`

4. Open GDM login screen
5. Insert card into the reader

Actual results:
1) system reognises smart card
2) user can pick certificate object
3) user can insert pin
4) "Sorry, smart card authentication didn't work. Please try again." appears in GDM (see attached screenshot)

Expected results:
1) system reognises smart card
2) user can pick certificate object
3) user can insert pin
4) login is successful

Additional info:
This bug is present on both RHEL-8 and RHEL-9. It is manifested in GDM and also in console login. It is possible that this scenario was always broken as it was most likely tested only with "with-smartcard" profile of sssd.

Comment 2 Marek Havrila 2022-12-02 16:23:01 UTC
Created attachment 1929406 [details]
p11_child.log

Comment 3 Marek Havrila 2022-12-02 16:23:57 UTC
Created attachment 1929409 [details]
sssd_pam.log

Comment 4 Marek Havrila 2022-12-02 16:24:38 UTC
Created attachment 1929410 [details]
sssd_shadowutils.log

Comment 5 Sumit Bose 2022-12-05 06:42:19 UTC
Hi,

there are various odd items in the logs. Can you set 'debug_level = 9' in the [domain/...] section as well?

There is '[pam] [child_sig_handler] (0x0020): [CID#14] child [9412] was terminated by signal [11].', can you check, e.g. with coredumpctl if there is a core dump and sent the backtrace?

Can you send your ssssd.conf as well?

Does the test work if 'p11_uri' is not set in sssd.conf?

bye,
Sumit

Comment 15 Alexey Tikhonov 2022-12-09 12:45:29 UTC
Pushed PR: https://github.com/SSSD/sssd/pull/6480

* `master`
    * aac303e84b71325d3c45fa7a22f83f7f54d4b7a2 - p11: fix size of argument array
* `sssd-2-8`
    * 20037ae5354a874f04802844c930c6b52704c5c7 - p11: fix size of argument array

Comment 25 errata-xmlrpc 2023-05-16 09:08:11 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 (sssd 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-2023:2986


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