Bug 1570649 - pwdhash segfaults when CRYPT storage scheme is used
Summary: pwdhash segfaults when CRYPT storage scheme is used
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base
Version: 7.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: mreynolds
QA Contact: RHDS QE
Marc Muehlfeld
Depends On:
TreeView+ depends on / blocked
Reported: 2018-04-23 11:35 UTC by Viktor Ashirov
Modified: 2020-09-13 22:09 UTC (History)
4 users (show)

Fixed In Version: 389-ds-base-
Doc Type: Bug Fix
Doc Text:
The *pwdhash* utility no longer crashes when using the *CRYPT* password storage scheme Previously, the *pwdhash* utility used an invalid mutex lock when creating a hash using the *CRYPT* password storage scheme. As a consequence, *pwdhash* failed with a segmentation fault error. With this update, the utility uses the re-entrant form of the "crypt()" function that does not require a lock. As a result, *pwdhash* no longer crashes when using the *CRYPT* password storage scheme.
Clone Of:
Last Closed: 2018-10-30 10:13:48 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 2708 0 None None None 2020-09-13 22:09:15 UTC
Red Hat Product Errata RHSA-2018:3127 0 None None None 2018-10-30 10:14:32 UTC

Description Viktor Ashirov 2018-04-23 11:35:14 UTC
Description of problem:
pwdhash -s CRYPT Secret123 
Segmentation fault (core dumped)

Version-Release number of selected component (if applicable):

How reproducible:

Additional info:
(gdb) r
Starting program: /usr/bin/pwdhash -s CRYPT Secret123
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
__GI___pthread_mutex_lock (mutex=mutex@entry=0x0) at ../nptl/pthread_mutex_lock.c:66
66	  unsigned int type = PTHREAD_MUTEX_TYPE_ELISION (mutex);
(gdb) bt 
#0  __GI___pthread_mutex_lock (mutex=mutex@entry=0x0) at ../nptl/pthread_mutex_lock.c:66
#1  0x00007ffff60a4ed9 in PR_Lock (lock=0x0) at ../../../nspr/pr/src/pthreads/ptsynch.c:176
#2  0x00007ffff09aaef1 in crypt_pw_enc_by_hash (pwd=0x555555f5a4e0 "Secret123", hash_algo=0) at ldap/servers/plugins/pwdstorage/crypt_pwd.c:116
#3  0x0000555555555cdf in main (argc=4, argv=0x7fffffffddc8) at ldap/servers/slapd/tools/pwenc.c:243

Comment 1 Viktor Ashirov 2018-04-23 11:40:44 UTC
Storage schemes CRYPT-MD5, CRYPT-SHA256, CRYPT-SHA512 are also producing a crash.

Comment 2 mreynolds 2018-04-23 13:51:39 UTC
Upstream ticket:

Comment 3 mreynolds 2018-04-24 15:04:48 UTC
Fixed upstream

Comment 5 Viktor Ashirov 2018-06-13 21:21:47 UTC
Build tested: 389-ds-base-

[root@rhel7 ~]# pwdhash -s CRYPT Secret123 

[root@rhel7 ~]# pwdhash -s CRYPT-MD5 Secret123 

[root@rhel7 ~]# pwdhash -s CRYPT-SHA256 Secret123 

[root@rhel7 ~]# pwdhash -s CRYPT-SHA512 Secret123 

pwdhash no longer crashes, marking as VERIFIED.

Comment 9 errata-xmlrpc 2018-10-30 10:13:48 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.


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