From: Martin Schwenke Date: Sat, 30 May 2026 07:35:23 +0000 (+1000) Subject: CVE-2026-58224: ctdb-daemon: Avoid out of bounds data access X-Git-Tag: talloc-2.5.0~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6129d0ee64f396ba52ea1a26f442f609e4df2fde;p=thirdparty%2Fsamba.git CVE-2026-58224: ctdb-daemon: Avoid out of bounds data access The count can't exceed the recdata buffer size. BUG: https://bugzilla.samba.org/show_bug.cgi?id=16085 Signed-off-by: Martin Schwenke Reviewed-by: Tristan Madani Reviewed-by: Stefan Metzmacher --- diff --git a/ctdb/server/ctdb_update_record.c b/ctdb/server/ctdb_update_record.c index 405499c81e2..154b1427410 100644 --- a/ctdb/server/ctdb_update_record.c +++ b/ctdb/server/ctdb_update_record.c @@ -318,6 +318,16 @@ int32_t ctdb_control_update_record(struct ctdb_context *ctdb, struct childwrite_handle *handle; struct ctdb_marshall_buffer *m = (struct ctdb_marshall_buffer *)recdata.dptr; + if (recdata.dsize < offsetof(struct ctdb_marshall_buffer, data)) { + DBG_ERR("Invalid packet\n"); + return -1; + } + if (m->count > + recdata.dsize - offsetof(struct ctdb_marshall_buffer, data)) { + DBG_ERR("Invalid packet\n"); + return -1; + } + if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) { DEBUG(DEBUG_INFO,("rejecting ctdb_control_update_record when recovery active\n")); return -1;