Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 875862 - crash in DNA if no dnamagicregen is specified
crash in DNA if no dnamagicregen is specified
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base (Show other bugs)
6.4
Unspecified Unspecified
medium Severity unspecified
: rc
: ---
Assigned To: Rich Megginson
Sankar Ramalingam
:
Depends On:
Blocks: 881827
  Show dependency treegraph
 
Reported: 2012-11-12 12:18 EST by Nathan Kinder
Modified: 2013-02-21 03:21 EST (History)
4 users (show)

See Also:
Fixed In Version: 389-ds-base-1.2.11.15-4.el6
Doc Type: Bug Fix
Doc Text:
Cause: The DNA plugin attempts to dereference a NULL pointer value for the dnaMagicRegen attribute. Consequence: If DNA is enabled and no dnamagicregen is specified in the DNA configuration, and an entry is added that has an attribute that triggers the DNA value generation, the server could crash. Fix: Check for an empty dnamagicregen value before attempting to dereference it. Result: The server does not crash with no dnamagicregen is specified.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:21:26 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0503 normal SHIPPED_LIVE Moderate: 389-ds-base security, bug fix, and enhancement update 2013-02-21 03:18:44 EST

  None (edit)
Description Nathan Kinder 2012-11-12 12:18:36 EST
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/517

If you have a DNA configuration to provide values for a given attribute, but do not specify the dnamagicregen attribute and value, and you attempt to add/modify that given attribute, the server will crash in _dna_pre_op_modify():
{{{
                        /* If we have a value, see if it's the magic value. */
                        if (bv) {
                            len = strlen(config_entry->generate);
                            if (len == bv->bv_len) {
                                if (!slapi_UTF8NCASECMP(bv->bv_val,
                                                        config_entry->generate,
                                                        len)) {
                                    slapi_ch_array_add(&types_to_generate,
                                                       slapi_ch_strdup(type));
                                }
                            }
}}}

because the server does not first check if config_entry->generate is NULL before doing the strlen.
Comment 2 Sankar Ramalingam 2013-01-28 04:03:56 EST
Request you to please add steps to Verify.
Comment 3 Noriko Hosoi 2013-01-28 11:36:56 EST
(In reply to comment #2)
> Request you to please add steps to Verify.

Mark, could you provide the steps?  Thanks!
Comment 4 mreynolds 2013-01-29 10:22:09 EST
This is an easy one.

To reproduce:

[1]  Setup the DNA plugin, but do NOT set "dnamagicregen"
[2]  Make an update that would trigger the DNA plugin to update an entry.
[3]  Server crashes.
Comment 5 Ján Rusnačko 2013-01-30 05:10:53 EST
[jrusnack@dstet ~]$ ldapsearch -h localhost -p 22222 -D "cn=directory manager " -w Secret123 -b "cn=uidNumber,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config" -LL
version: 1

dn: cn=uidNumber,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config
objectClass: top
objectClass: extensibleObject
cn: uidNumber
dnaType: uidNumber
dnaNextValue: 2
dnaMaxValue: 1300
dnaThreshold: 200
dnaFilter: (objectClass=posixAccount)
dnaScope: ou=people,o=my.com

[jrusnack@dstet ~]$ ldapmodify  -h localhost -p 22222 -D "cn=directory manager " -w Secret123 -a <<EOF
dn: uid=tuser2,ou=people,o=my.com
objectclass: top
objectclass: posixAccount
objectclass: person
objectclass: inetorgperson
cn: tuser2
uid: tuser2
sn: tuser2
homeDirectory: /home/tuser2
gidNumber: 2
EOF

adding new entry "uid=tuser2,ou=people,o=my.com"
[jrusnack@dstet ~]$ ldapsearch -h localhost -p 22222 -D "cn=directory manager " -w Secret123 -LLL -b "uid=tuser2,ou=people,o=my.com"
dn: uid=tuser2,ou=People,o=my.com
objectClass: top
objectClass: posixAccount
objectClass: person
objectClass: inetorgperson
objectClass: organizationalPerson
cn: tuser2
uid: tuser2
sn: tuser2
homeDirectory: /home/tuser2
gidNumber: 2
uidNumber: 2

[jrusnack@dstet ~]$ rpm -qa 389*
389-ds-base-1.2.11.15-11.el6.x86_64
389-ds-base-libs-1.2.11.15-11.el6.x86_64


Verified.
Comment 6 errata-xmlrpc 2013-02-21 03:21:26 EST
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/RHSA-2013-0503.html

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