Issue 7485 - libmdb key/data limits not checked/documented.
Summary: libmdb key/data limits not checked/documented.
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-06 17:02 UTC by Hallvard Furuseth
Modified: 2014-08-01 21:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Hallvard Furuseth 2013-01-06 17:02:11 UTC
Full_Name: Hallvard B Furuseth
Version: mdb.master 057e0686303444d56f29a7bee0536e261fdf0b6a
OS: Linux x86_64
URL: 
Submission from: (NULL) (193.69.163.163)
Submitted by: hallvard


mdb_put() not check for too big data.  mdb_cursor_put() does not
check for too big key either.  Nor can I see that ldmb.h documents
the limits, and there is no way to ask liblmdb what the limits are.

This can write an item of size (5000000000 & 0xffffffff) or crash:
  MDB_val k1 = {3, "foo"}, x = {5000000000, NULL};
  mdb_dbi_open(txn, NULL, MDB_CREATE, &dbi);
  mdb_put(txn, dbi, &k1, &x, MDB_RESERVE);

Crash:
  MDB_val k1 = {3, "foo"}, y = {5, "xyzzy"}, z = {10000, calloc(1,10000)};
  mdb_dbi_open(txn, NULL, MDB_CREATE|MDB_DUPSORT, &dbi);
  mdb_put(txn, dbi, &k1, &y, 0);
  mdb_put(txn, dbi, &k1, &z, 0); /* segfault */

Crash:
  MDB_val k2 = {8000, calloc(1, 8000)}, y = {5, "xyzzy"};
  mdb_cursor_put(mc, &k2, &y, 0);
while this gives a proper EINVAL:
  mdb_put(txn, dbi, &k2, &y, 0);
Comment 1 Howard Chu 2013-01-15 15:45:36 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 2 Quanah Gibson-Mount 2013-01-27 02:28:50 UTC
changed notes
changed state Test to Release
Comment 3 Quanah Gibson-Mount 2013-03-05 02:25:33 UTC
changed notes
changed state Release to Closed
Comment 4 OpenLDAP project 2014-08-01 21:04:45 UTC
fixed in master
fixed in RE24