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 1668859

Summary: certutil -F with no parameters is killed with segmentation fault message
Product: Red Hat Enterprise Linux 8 Reporter: Alicja Kario <hkario>
Component: nssAssignee: nss-nspr-maint <nss-nspr-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Tomas Mraz <tmraz>
Severity: unspecified Docs Contact:
Priority: low    
Version: 8.0CC: cww, dueno, mthacker, rcadova, rrelyea, snagar, ssorce, tmraz, toneata
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: 8.0Flags: ssorce: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nss-3.44.0-5.el8_0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1725115 (view as bug list) Environment:
Last Closed: 2019-08-05 08:18:55 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: 1679667    
Bug Blocks: 1725115    

Description Alicja Kario 2019-01-23 18:07:15 UTC
Description of problem:
When `certutil -F` is ran, it the process is killed with SIGSEGV

Version-Release number of selected component (if applicable):
nss-tools-3.41.0-5.el8.x86_64

How reproducible:
always

Steps to Reproduce:
1. gdb certutil
2. run -F

Actual results:
(gdb) run -F
Starting program: /usr/bin/certutil -F
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6720715 in __strlen_avx2 () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff6720715 in __strlen_avx2 () from /lib64/libc.so.6
#1  0x00007ffff756c229 in cvt_s (flags=0, prec=<optimized out>, width=0, 
    str=0x46 <error: Cannot access memory at address 0x46>, ss=0x7fffffffdf10)
    at ../../.././nspr/pr/src/io/prprf.c:374
#2  dosprintf (ss=ss@entry=0x7fffffffdf10, 
    fmt=0x55555557842a " -%c: specify a nickname (-n) or\n   a key ID (-k).\n", 
    ap=ap@entry=0x7fffffffdf80) at ../../.././nspr/pr/src/io/prprf.c:1018
#3  0x00007ffff756c4fe in PR_vsmprintf (fmt=<optimized out>, ap=ap@entry=0x7fffffffdf80)
    at ../../.././nspr/pr/src/io/prprf.c:1184
#4  0x00007ffff756de0b in PR_vfprintf (fd=0x5555557848c0, fmt=<optimized out>, 
    ap=ap@entry=0x7fffffffdf80) at ../../.././nspr/pr/src/io/prstdio.c:28
#5  0x00007ffff756ded8 in PR_fprintf (fd=<optimized out>, fmt=<optimized out>)
    at ../../.././nspr/pr/src/io/prstdio.c:19
#6  0x0000555555565445 in certutil_main (argc=<optimized out>, argv=<optimized out>, initialize=1)
    at certutil.c:3120
#7  0x000055555555d1df in main (argc=<optimized out>, argv=<optimized out>) at certutil.c:4032

Expected results:
error message printe about missing options

Additional info:
Not present in RHEL-7, technically a regression...

Comment 7 Tomas Mraz 2019-06-28 08:50:08 UTC
Old package fails:

 1minutetip 1MT-RHEL-8.0.0-released
[ INFO  ] 1MT-RHEL-8.0.0-released is the chosen one
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Test run ID   : 27816001
    Package       : nss
    Installed     : nss-3.41.0-5.el8.x86_64
    beakerlib RPM : beakerlib-1.18-6.el8bkr.noarch
    bl-redhat RPM : beakerlib-redhat-1-32.el8bkr.noarch
    Test name     : /CoreOS/nss/Regression/bz807419-nss-tools-certutil-H-does-not-list-all-options
    Test version  : 1.0
    Test started  : 2019-06-28 04:14:32 EDT
    Test finished : 2019-06-28 04:14:36 EDT (still running)
    Test duration : 4 seconds
    Distro        : Red Hat Enterprise Linux release 8.0 (Ootpa)
    Hostname      : ci-vm-10-0-137-52.hosted.upshift.rdu2.redhat.com
    Architecture  : x86_64
    CPUs          : 1 x Intel Xeon Processor (Skylake, IBRS)
    RAM size      : 1829 MB
    HDD size      : 19.98 GB

...
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

...
:: [ 04:14:33 ] :: [  BEGIN   ] :: Testing recognition of option -F :: actually running 'certutil -F'
/usr/share/beakerlib/testing.sh: line 891:  8198 Segmentation fault      (core dumped) certutil -F
:: [ 04:14:33 ] :: [   FAIL   ] :: Testing recognition of option -F (Expected 255, got 139)
:: [ 04:14:33 ] :: [  BEGIN   ] :: Testing presence of option -F in help message :: actually running 'certutil -H 2>&1 | grep -E -- '(^|[[:space:]])-F([[:space:]]|$)''
-F              Delete a key and associated certificate from the database
:: [ 04:14:33 ] :: [   PASS   ] :: Testing presence of option -F in help message (Expected 0, got 0)
...

Test failed with old package.

New package:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Test run ID   : 29329001
    Package       : nss
    Installed     : nss-3.44.0-5.el8_0.x86_64
    beakerlib RPM : beakerlib-1.18-6.el8bkr.noarch
    bl-redhat RPM : beakerlib-redhat-1-32.el8bkr.noarch
    Test name     : /CoreOS/nss/Regression/bz807419-nss-tools-certutil-H-does-not-list-all-options
    Test version  : 1.0
    Test started  : 2019-06-28 04:48:06 EDT
    Test finished : 2019-06-28 04:48:10 EDT (still running)
    Test duration : 4 seconds
    Distro        : Red Hat Enterprise Linux release 8.0 (Ootpa)
    Hostname      : ci-vm-10-0-137-86.hosted.upshift.rdu2.redhat.com
    Architecture  : x86_64
    CPUs          : 1 x Intel Xeon Processor (Skylake, IBRS)
    RAM size      : 1829 MB
    HDD size      : 19.98 GB

...

:: [ 04:48:07 ] :: [  BEGIN   ] :: Testing recognition of option -F :: actually running 'certutil -F'
certutil -F: specify a nickname (-n) or
   a key ID (-k).
:: [ 04:48:07 ] :: [   PASS   ] :: Testing recognition of option -F (Expected 255, got 255)
:: [ 04:48:07 ] :: [  BEGIN   ] :: Testing presence of option -F in help message :: actually running 'certutil -H 2>&1 | grep -E -- '(^|[[:space:]])-F([[:space:]]|$)''
-F              Delete a key and associated certificate from the database
:: [ 04:48:07 ] :: [   PASS   ] :: Testing presence of option -F in help message (Expected 0, got 0)
...

Test passed with the new package nss-3.44.0-5.el8_0