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 1517979

Summary: heap-buffer-overflow in slapi_dn_find_parent_ext
Product: Red Hat Enterprise Linux 7 Reporter: Viktor Ashirov <vashirov>
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED WORKSFORME QA Contact: RHDS QE <ds-qe-bugs>
Severity: unspecified Docs Contact:
Priority: high    
Version: 7.5CC: nkinder, pasik, rmeggins, vashirov
Target Milestone: rc   
Target Release: 7.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-28 15:14:56 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:

Description Viktor Ashirov 2017-11-27 19:46:58 UTC
Description of problem:
=================================================================
==7125== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x600400511edb at pc 0x7f46b06bd758 bp 0x7f467b9ce590 sp 0x7f467b9ce580
READ of size 1 at 0x600400511edb thread T31
==7125== WARNING: Trying to symbolize code, but external symbolizer is not initialized!
    #0 0x7f46b06bd757 in slapi_dn_find_parent_ext /usr/src/debug/389-ds-base-1.3.7.5/ldap/servers/slapd/dn.c:1633
    #1 0x7f46b06bd8d8 in slapi_dn_parent /usr/src/debug/389-ds-base-1.3.7.5/ldap/servers/slapd/dn.c:1668
    #2 0x7f46b0738753 in do_modrdn /usr/src/debug/389-ds-base-1.3.7.5/ldap/servers/slapd/modrdn.c:175
    #3 0x5633f97c0e54 in ?? /usr/src/debug/389-ds-base-1.3.7.5/ldap/servers/slapd/connection.c:619
    #4 0x7f46ae84bc8a in PR_Select /usr/src/debug/nspr-4.17.0/pr/src/pthreads/../../../nspr/pr/src/pthreads/ptthread.c:216
    #5 0x7f46b0d40867 in _ZN6__asan10AsanThread11ThreadStartEv _asan_rtl_
    #6 0x7f46ae1ebdd4 in start_thread /usr/src/debug/glibc-2.17-c758a686/nptl/pthread_create.c:308
    #7 0x7f46ad8999bc in __clone /usr/src/debug////////glibc-2.17-c758a686/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:113
0x600400511edb is located 0 bytes to the right of 11-byte region [0x600400511ed0,0x600400511edb)
allocated by thread T31 here:
    #0 0x7f46b0d3cef9 in malloc _asan_rtl_
    #1 0x7f46ad8276e9 in __GI___strdup /usr/src/debug/glibc-2.17-c758a686/string/strdup.c:42
Thread T31 created by T0 here:
    #0 0x7f46b0d31a0a in __interceptor_pthread_create _asan_rtl_
    #1 0x7f46ae84b95b in PR_Select /usr/src/debug/nspr-4.17.0/pr/src/pthreads/../../../nspr/pr/src/pthreads/ptthread.c:457
    #2 0x0
Shadow bytes around the buggy address:
  0x0c010009a380: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c010009a390: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c010009a3a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c010009a3b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c010009a3c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c010009a3d0: fa fa fa fa fa fa fa fa fa fa 00[03]fa fa fd fd
  0x0c010009a3e0: fa fa 00 03 fa fa 00 03 fa fa fd fd fa fa 00 03
  0x0c010009a3f0: fa fa 00 02 fa fa 00 03 fa fa 07 fa fa fa fd fa
  0x0c010009a400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c010009a410: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c010009a420: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:     fa
  Heap righ redzone:     fb
  Freed Heap region:     fd
  Stack left redzone:    f1
  Stack mid redzone:     f2
  Stack right redzone:   f3
  Stack partial redzone: f4
  Stack after return:    f5
  Stack use after scope: f8
  Global redzone:        f9
  Global init order:     f6
  Poisoned by user:      f7
  ASan internal:         fe
==7125== ABORTING


Version-Release number of selected component (if applicable):
389-ds-base-1.3.7.5-10.el7.x86_64

Comment 2 wibrown@redhat.com 2017-11-28 14:44:46 UTC
I think to solve this I'll need some more info about what DN is the problem. It may be that the DN is not null terminated which is what leads to this issue ...

Comment 3 wibrown@redhat.com 2017-11-28 15:37:34 UTC
Upstream ticket:
https://pagure.io/389-ds-base/issue/49472