Bug 875862 - crash in DNA if no dnamagicregen is specified
Summary: crash in DNA if no dnamagicregen is specified
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base
Version: 6.4
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Rich Megginson
QA Contact: Sankar Ramalingam
URL:
Whiteboard:
Depends On:
Blocks: 881827
TreeView+ depends on / blocked
 
Reported: 2012-11-12 17:18 UTC by Nathan Kinder
Modified: 2013-02-21 08:21 UTC (History)
4 users (show)

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.
Clone Of:
Environment:
Last Closed: 2013-02-21 08:21:26 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System 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 08:18:44 UTC

Description Nathan Kinder 2012-11-12 17:18:36 UTC
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 09:03:56 UTC
Request you to please add steps to Verify.

Comment 3 Noriko Hosoi 2013-01-28 16:36:56 UTC
(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 15:22:09 UTC
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 10:10:53 UTC
[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 08:21:26 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/RHSA-2013-0503.html


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