Bug 1881500
| Summary: | Certmonger segfault after cert renewal request | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Aleksandr Sharov <asharov> |
| Component: | certmonger | Assignee: | Rob Crittenden <rcritten> |
| Status: | CLOSED ERRATA | QA Contact: | ipa-qe <ipa-qe> |
| Severity: | low | Docs Contact: | |
| Priority: | medium | ||
| Version: | 8.3 | CC: | myusuf, pcech, pvoborni, rcritten, ssidhaye, twoerner |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 8.5 | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | certmonger-0.79.13-4.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-05-10 13:38:10 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: | |||
It is failing while iterating through the set of certificates due to the failed request 'dogtag-ipa-renew-agent'. Can you provide this request? It's in /var/lib/certmonger/requests/<some_id>. A simple grep for 'dogtag-ipa-renew-agent' should identify it from the other request.
#1 0x000055dc4032245d in base_add_request (conn=0x55dc420ebf10,
msg=0x55dc420ec450, ci=0x7ffe02627170, ctx=0x55dc420d2b50) at tdbush.c:681
681 if (strcmp(cert_location, e->cm_cert_storage_location) != 0) {
(gdb) print cert_location
$3 = 0x55dc420dfce0 "/etc/pki/tls/certs/cmgmr01.prod.csp.local.pem"
(gdb) print e->cm_cert_storage_location
$4 = 0x0
Any guess how this request was made? It would help tighten up the code as it appears now to assume that this will always be set (which I can also fix).
I think to resolve this simply deleting the failed request will fix it but I'd like the chance to look at it first.
Hi Rob! I've requested it from the client, you can see it attached to the case. Thank you! It is safe to remove this with: getcert stop-tracking -i dogtag-ipa-renew-agent That should fix things. I'm curious how this was created at all. It is effectively completely empty: id=dogtag-ipa-renew-agent key_type=UNSPECIFIED key_gen_type=UNSPECIFIED key_size=0 key_gen_size=0 key_next_type=UNSPECIFIED key_next_gen_type=UNSPECIFIED key_next_size=0 key_next_gen_size=0 key_preserve=0 key_storage_type=NONE key_perms=0 key_requested_count=0 key_issued_count=0 cert_storage_type=FILE cert_perms=0 cert_is_ca=0 cert_ca_path_length=0 cert_no_ocsp_check=0 last_need_notify_check=19700101000000 last_need_enroll_check=19700101000000 template_is_ca=0 template_ca_path_length=-1 template_no_ocsp_check=0 state=NEED_KEY_PAIR autorenew=0 monitor=0 submitted=19700101000000 Cloned upstream to https://pagure.io/certmonger/issue/191 Moving to RHEL 8. Upstream PR https://pagure.io/certmonger/pull-request/192 Thank you taking your time and submitting this request for Red Hat Enterprise Linux 7. Red Hat Enterprise Linux 7 is in Maintenance Support 2 Phase. This bug was reevaluated and will be postponed to RHEL 8. Thank you for understanding. Red Hat Enterprise Linux Identity Management Team merged upstream: 0eec70b9dbd0a50a24fe173a68fd9ab72857e08d version:
certmonger-0.79.13-5.el8.x86_64
Steps:
[root@master ~]# systemctl stop certmonger
[root@master ~]# cat > /var/lib/certmonger/requests/20211125062617 << EOF
id=dogtag-ipa-renew-agent
key_type=UNSPECIFIED
key_gen_type=UNSPECIFIED
key_size=0
key_gen_size=0
key_next_type=UNSPECIFIED
key_next_gen_type=UNSPECIFIED
key_next_size=0
key_next_gen_size=0
key_preserve=0
key_storage_type=NONE
key_perms=0
key_requested_count=0
key_issued_count=0
cert_storage_type=FILE
cert_perms=0
cert_is_ca=0
cert_ca_path_length=0
cert_no_ocsp_check=0
last_need_notify_check=19700101000000
last_need_enroll_check=19700101000000
template_is_ca=0
template_ca_path_length=-1
template_no_ocsp_check=0
state=NEED_KEY_PAIR
autorenew=0
monitor=0
submitted=19700101000000
EOF
[root@master ~]# systemctl start certmonger
[root@master ~]# systemctl status certmonger
● certmonger.service - Certificate monitoring and PKI enrollment
Loaded: loaded (/usr/lib/systemd/system/certmonger.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-11-25 02:02:30 EST; 7s ago
Main PID: 27878 (certmonger)
Tasks: 19 (limit: 23443)
Memory: 559.8M
CGroup: /system.slice/certmonger.service
├─27878 /usr/sbin/certmonger -S -p /run/certmonger.pid -n -d2
├─27933 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit
├─27939 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit
├─27940 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit
├─27941 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --reuse-existing
├─27942 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --reuse-existing
├─27944 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --reuse-existing
├─27945 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --reuse-existing
├─27946 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --reuse-existing
├─27947 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --reuse-existing
├─27948 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --reuse-existing
├─27949 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --reuse-existing
├─27953 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --force-self-signed
├─27954 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --force-self-signed
├─27955 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --force-self-signed
├─27956 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --force-self-signed
├─27957 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --force-self-signed
├─27958 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --force-self-signed
└─27959 /usr/libexec/platform-python -I /usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit --force-self-signed
Nov 25 02:02:33 master.testrelm.test certmonger[27878]: 2021-11-25 02:02:33 [27954] Running enrollment/cadata helper "/usr/lib>
Nov 25 02:02:33 master.testrelm.test certmonger[27878]: 2021-11-25 02:02:33 [27955] Running enrollment/cadata helper "/usr/lib>
[root@master ~]#
[root@master ~]# getcert list -i dogtag-ipa-renew-agent
Request ID 'dogtag-ipa-renew-agent':
status: NEED_KEY_PAIR
stuck: no
key pair storage: type=NONE
certificate: type=FILE,location=''
issuer:
subject:
issued: unknown
expires: unknown
pre-save command:
post-save command:
track: no
auto-renew: no
[root@master ~]# ipa-getcert request -k /etc/pki/tls/private/test.key -f /etc/pki/tls/certs/test.pem
New signing request "20211125070352" added.
[root@master ~]# getcert list -i 20211125070352
Number of certificates and requests being tracked: 11.
Request ID '20211125070352':
status: MONITORING
stuck: no
key pair storage: type=FILE,location='/etc/pki/tls/private/test.key'
certificate: type=FILE,location='/etc/pki/tls/certs/test.pem'
CA: IPA
issuer: CN=Certificate Authority,O=TESTRELM.TEST
subject: CN=master.testrelm.test,O=TESTRELM.TEST
issued: 2021-11-25 02:03:53 EST
expires: 2023-11-26 02:03:53 EST
dns: master.testrelm.test
principal name: host/master.testrelm.test
key usage: digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment
eku: id-kp-serverAuth,id-kp-clientAuth
pre-save command:
post-save command:
track: yes
auto-renew: yes
[root@master ~]#
Cert request succeed. Certmonger is working as expected. Hence marking the bug as verified.
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 (certmonger 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-2022:1789 |
Description of problem: Command # ipa-getcert request -k /etc/pki/tls/private/cmgmr01.prod.csp.local.key -f /etc/pki/tls/certs/cmgmr01.prod.csp.local.pem gets certmonger to segfault with error: Sep 9 12:48:01 cmgmr01 kernel: certmonger[14515]: segfault at 0 ip 00007f09ca36cdaa sp 00007ffe4d9358c8 error 4 in libc-2.17.so[7f09ca22e000+1c3000] Sep 9 12:48:01 cmgmr01 systemd: certmonger.service: main process exited, code=killed, status=11/SEGV Sep 9 12:48:01 cmgmr01 systemd: Unit certmonger.service entered failed state. Sep 9 12:48:01 cmgmr01 systemd: certmonger.service failed. Version-Release number of selected component (if applicable): certmonger-0.78.4-12.el7.x86_64 How reproducible: always Steps to Reproduce: Described earlier Actual results: Certmonger enters failed state after segfault Expected results: Certmonger handles command correctly Additional info: After failing, certmonger restarts normally and works fine until another request. Sosreport and coredump file are attached to the linked case. [root@cmgmr01 chatfir]# getcert list Number of certificates and requests being tracked: 2. Request ID 'dogtag-ipa-renew-agent': status: NEED_KEY_PAIR stuck: no key pair storage: type=NONE certificate: type=FILE,location='' issuer: subject: expires: unknown pre-save command: post-save command: track: no auto-renew: no Request ID '20180911095336': status: MONITORING stuck: no key pair storage: type=FILE,location='/opt/cloudera/security/key.pem' certificate: type=FILE,location='/opt/cloudera/security/cert.pem' CA: IPA issuer: CN=Certificate Authority,O=PROD.CSP.LOCAL subject: CN=cmgmr01.prod.csp.local,O=PROD.CSP.LOCAL expires: 2022-09-09 14:57:40 UTC dns: cmgmr01.prod.csp.local principal name: host/cmgmr01.prod.csp.local.LOCAL key usage: digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment eku: id-kp-serverAuth,id-kp-clientAuth pre-save command: post-save command: track: yes auto-renew: yes