Bug 733443 - large targetattr list with syntax errors cause server to crash or hang
Summary: large targetattr list with syntax errors cause server to crash or hang
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Rich Megginson
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On: 733103
Blocks: 690318 389_1.2.9
TreeView+ depends on / blocked
 
Reported: 2011-08-25 17:47 UTC by Rich Megginson
Modified: 2015-01-04 23:50 UTC (History)
5 users (show)

Fixed In Version: 389-ds-base-1.2.9.8-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 733103
Environment:
Last Closed: 2011-12-06 17:56:15 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2011:1711 normal SHIPPED_LIVE 389-ds-base bug fix and enhancement update 2011-12-06 01:02:20 UTC

Description Rich Megginson 2011-08-25 17:47:08 UTC
+++ This bug was initially created as a clone of Bug #733103 +++

For example, an aci like this:
aci: (targetattr = "physicalDeliveryOfficeName || homePhone || preferredDeliveryMethod || jpegPhoto || nsAIMid || mozillaHomeCountryName || audio || internationaliSDNNumber || postalAddress || roomNumber || mozillaWorkStreet2 || givenName || mozillaSecondEmail || userPKCS12 || userPassword || teletexTerminalIdentifier || mobile || manager || objectClass || userSMIMECertificate || mozillaHomeStreet || destinationIndicator || telexNumber || employeeNumber || secretary || uid || userCertificate || st || mozillaCustom4 || mozillaCustom3 || mozillaCustom2 || mozillaCustom1 || description || mozillaHomePostalCode || mail || labeledUri || businessCategory || x500UniqueIdentifier || ou || seeAlso || photo || mozillaNickname || mozillaHomeLocalityName || shadowLastChange || title || street || departmentNumber || mozillaHomeStreet2 || mozillaUseHtmlMail || mozillaHomeState || o || cn || l || initials || telephoneNumber || mozillaHomeUrl || x121Address") (version 3.0; acl "Authenticated user self access"; allow (read,compare,search,write)(userdn = "ldap:///self");)

where one or more of the attributes in the targetattr list are not defined, and the list contains more than 5 elements.

Adding this aci will cause the server to either crash or hang.

--- Additional comment from rmeggins@redhat.com on 2011-08-24 15:17:15 EDT ---

Created attachment 519695 [details]
0001-Bug-733103-large-targetattr-list-with-syntax-errors-.patch

--- Additional comment from rmeggins@redhat.com on 2011-08-24 16:08:23 EDT ---

To ssh://git.fedorahosted.org/git/389/ds.git
   7e43a28..91c6799  master -> master
commit 91c6799b07ca48bce85482136ceb244b484fc91b
Author: Rich Megginson <rmeggins@redhat.com>
Date:   Wed Aug 24 13:13:35 2011 -0600
    Reviewed by: nhosoi (Thanks!)
    Branch: master
    Fix Description: If we need to realloc the list to hold more target attributes,
    the list is not NULL terminated.  If there are syntax errors in the aci, the
    function returns with an unterminated list, and this will either cause the
    loop in the free code to go off the end of the list or crash with a segfault.
    The fix is to make sure the list is always NULL terminated.
    Platforms tested: RHEL6 x86_64
    Flag Day: no
    Doc impact: no

Comment 2 Amita Sharma 2011-09-27 07:05:11 UTC
[root@snmaptest fourwaymmr]# ldapmodify -h localhost -p 389 -D "cn=Directory
Manager" -w Secret123 << EOF
> dn: dc=example,dc=com
> changetype: modify
> replace: aci
> aci: (targetattr = "physicalDeliveryOfficeName || homePhone || preferredDeliveryMethod || jpegPhoto || nsAIMid || mozillaHomeCountryName || audio ||internationaliSDNNumber || postalAddress || roomNumber || mozillaWorkStreet2 || givenName || mozillaSecondEmail || userPKCS12 || userPassword || teletexTerminalIdentifier || mobile || manager || objectClass || userSMIMECertificate || mozillaHomeStreet || destinationIndicator || telexNumber || employeeNumber || secretary || uid || userCertificate || st || mozillaCustom4 || mozillaCustom3 || mozillaCustom2 || mozillaCustom1 || description || mozillaHomePostalCode || mail || labeledUri || businessCategory || x500UniqueIdentifier || ou || seeAlso || photo || mozillaNickname || mozillaHomeLocalityName || shadowLastChange || title || street || departmentNumber || mozillaHomeStreet2 || mozillaUseHtmlMail || mozillaHomeState || o || cn || l || initials || telephoneNumber || mozillaHomeUrl || x121Address") (version 3.0; acl "Authenticated user self access"; allow (read,compare,search,write)(userdn="ldap:///cn=Userami,dc=example,dc=com");)
> EOF
modifying entry "dc=example,dc=com"

No Crash found, hence VERIFIED.

Comment 3 errata-xmlrpc 2011-12-06 17:56:15 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.

http://rhn.redhat.com/errata/RHEA-2011-1711.html


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