Bug 1613174

Summary: ISC dhcpd cannot start TLS session to 389-DS after updating openldap rpm
Product: Red Hat Enterprise Linux 7 Reporter: admin
Component: dhcpAssignee: Pavel Zhukov <pzhukov>
Status: CLOSED ERRATA QA Contact: Martin Osvald 🛹 <mosvald>
Severity: medium Docs Contact:
Priority: high    
Version: 7.5CC: fkrska, mosvald, rsahoo, thozza
Target Milestone: rcKeywords: Regression, TestOnly
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: bind-9.11.4-4.P2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1660865 (view as bug list) Environment:
Last Closed: 2019-08-06 12:40: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:
Bug Depends On: 1668398, 1685940    
Bug Blocks: 1630905, 1630913, 1660865, 1663257    

Description admin 2018-08-07 08:02:52 UTC
Description of problem: Dhcp server cannot start TLS session to 389 Directory server after updating openldap from 2.4.44-5 to newist version.
Error: Cannot start TLS session to 10.0.252.31:389: Connect error

dhcpd version: 4.2.5-68
389-ds-base verson: 1.3.7.5-21

When I try manually copy old libraries (liblber, libldap, libslapi) back to updated system, dhcpd works fine with TLS to 389-DS.


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


How reproducible:always


Steps to Reproduce:
1.see description
2.
3.

Actual results: Error: Cannot start TLS session to 10.0.252.31:389: Connect error


Expected results:


Additional info: We can disable TLS by "ldap-ssl off" option at /etc/dhcp/dhcpd.conf as a workaround.

Comment 2 Matus Honek 2018-08-08 13:46:40 UTC
This seems to me to be the very same as bug 1590660. The bug is internal-only and not within my jurisdiction any more, however it seems the issue is the dhcpd does not initialize libldap's TLS context properly. I'm changing the component to 'dhcp' so as to be handled on their side.

Comment 3 Ramesh Sahoo 2018-08-20 02:54:04 UTC
*** Bug 1590660 has been marked as a duplicate of this bug. ***

Comment 10 Pavel Zhukov 2019-01-22 16:04:40 UTC
The problem came from bind dst library [1]. it effectively breaks random numbers generation for any client but BIND [2] so SSL_connect fails with -1.
As a workaround we can call ldap_set_option(NEWCTX) from within dhcp code before isc_lib_register() to use default implementation but I'm not sure if it'll not break anything else.  At first glance it should not.

[1] 
#0  dst__entropy_getdata (buf=0x7ffff7fc71c8, len=16, pseudo=pseudo@entry=isc_boolean_false) at ../../../lib/dns/dst_api.c:1918
#1  0x00007ffff775f47f in entropy_get (buf=<optimized out>, num=<optimized out>) at ../../../lib/dns/openssl_link.c:73
#2  0x00007ffff3e7cca0 in SSL_CTX_new (meth=0x7ffff40a2820 <SSLv23_method_data.18871>) at ssl_lib.c:2003
#3  0x00007ffff6dde7e1 in ldap_int_tls_init_ctx (lo=0x7ffff6ffc040 <ldap_int_global_options>, is_server=0) at tls2.c:269
#4  0x00007ffff6ddf1f6 in ldap_pvt_tls_set_option (ld=ld@entry=0x0, option=option@entry=24591, arg=arg@entry=0x7fffffffd300) at tls2.c:864
#5  0x00007ffff6dd3e8b in ldap_set_option (ld=0x0, option=option@entry=24591, invalue=invalue@entry=0x7fffffffd300) at options.c:787
#6  0x00005555555a204c in ldap_start () at ldap.c:803
#7  0x00005555555a39d5 in ldap_read_config () at ldap.c:1383
#8  0x0000555555561646 in main (argc=<optimized out>, argv=<optimized out>) at dhcpd.c:617

[2]
isc_result_t
dst__entropy_getdata(void *buf, unsigned int len, isc_boolean_t pseudo) {
#ifdef BIND9
[ ... omitted ... ] 
#else
	UNUSED(buf);
	UNUSED(len);
	UNUSED(pseudo);

	return (ISC_R_NOTIMPLEMENTED);    // <=  !!!!! FAIL !!!!
#endif

Comment 15 errata-xmlrpc 2019-08-06 12:40:10 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.

https://access.redhat.com/errata/RHSA-2019:2060