Bug 852839 - variable dn should not be used in ldbm_back_delete
variable dn should not be used in ldbm_back_delete
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:
  Show dependency treegraph
 
Reported: 2012-08-29 14:00 EDT by Nathan Kinder
Modified: 2013-02-21 03:20 EST (History)
3 users (show)

See Also:
Fixed In Version: 389-ds-base-1.2.11.12-1.el6
Doc Type: Bug Fix
Doc Text:
Cause: Uninitialized variable dn was referred in the backend delete error message. Consequence: If deleting an entry fails in the backend layer, logging an error message fails the server. Fix: This patch initializes the variable properly. Result: Deletion error is properly logged in the error log.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:20:43 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)

  None (edit)
Description Nathan Kinder 2012-08-29 14:00:13 EDT
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/437

The variable
char *dn = NULL;
appears to be used in several places in ldbm_back_delete - perhaps references to this variable were not changed to sdn or sdnp when the code was converted to use Slapi_DN instead of string dns?
Comment 1 Jenny Galipeau 2012-08-29 14:16:55 EDT
Please add steps to reproduce /verify
Comment 2 Noriko Hosoi 2012-08-29 15:25:53 EDT
The fix is pushed to origin/389-ds-base-1.2.11.

This is a potential crash bug.
1. trying to delete a tombstone entry but it turned out it is not a tombstone.
2. trying to make a tombstone entry from a tombstone.
3. deleting an entry causes a collision with other operation.
These 3 could crash the server.  The first 2 are less likely happening, but the 3rd one could be in a stress.

To verify this bug, making any of these 3 would be tricky.  But there is a DEBUG code which referrs the variable.  The code is enabled only when --enable-debug is used to build the server AND replication log level is set.

Once, the build candidate is built and the git tag is set, I'm going to build the server with --enable-debug and run the test.
Comment 5 Noriko Hosoi 2012-09-25 18:27:51 EDT
Steps to verify:

Downloaded src RPM: 389-ds-base-1.2.11.15-1.el6.src.rpm (info) (download)
... 3040242 Sep 25 13:47 389-ds-base-1.2.11.15-1.el6.src.rpm

Built from the src rpm with --enable-debug

Set up 2-way MMR; set the replication log level.

Added uid=Nuser2,dc=example,dc=com, then deleted it, which is correctly logged as follows:

[...] ldbm_back_delete - entry: uid=Nuser2,dc=example,dc=com  - flags: delete 0 is_tombstone_entry 0 create 1 

If 'dn' is not initialized correctly as this bug originally reported, this message should not be able to have "uid=Nuser2,dc=example,dc=com".

Hence, this bug is verified.
Comment 6 errata-xmlrpc 2013-02-21 03:20:43 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.