CVE-2023-0614 ldb: Add function to take ownership of an ldb message
commit891ffeaf99d150e2a5707d71825e5533570aa974
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 3 Mar 2023 04:23:42 +0000 (3 17:23 +1300)
committerJule Anger <janger@samba.org>
Mon, 20 Mar 2023 09:03:38 +0000 (20 10:03 +0100)
treefc597c63cf95b77086479032306a93dffd6c4ae1
parent6519d1d8fa1e1154a388a3bff319da2b0387f157
CVE-2023-0614 ldb: Add function to take ownership of an ldb message

Many places in Samba depend upon various components of an ldb message
being talloc allocated, and hence able to be used as talloc contexts.
The elements and values of an unpacked ldb message point to unowned data
inside the memory-mapped database, and this function ensures that such
messages have talloc ownership of said elements and values.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15270

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/common/ldb_pack.c
lib/ldb/include/ldb_module.h