Repository navigation
fix: validate DBD::DBM MLDBM serializer before lock file is created - #201
Merged
Merged
Conversation
…CVE-2026-111879)
This was a bug introduced by the fix for CVE-2026-78030.
The exception unwound DBI::DBD::SqlEngine::Table::new before the Table object
was blessed, so no DESTROY ever releases the lock, while $meta (with the
open, locked lockfh) stays cached in $dbh->{sql_meta}{t_ser}. The next
open of the table opens a second descriptor on the same .lck and blocks in
flock() -- forever, because the holder is the same process.
Why only the Gofer variant hung: in plain mode the DROP reuses the same
$meta, so DBD::File's $meta->{lockfh} = $fh drops the old handle (and
with it the lock) just before it calls flock. Under Gofer the DROP is
served by a different server-side dbh with its own fresh $meta, so the
stale handle is never replaced. The same thing happens without Gofer for
any second handle or any second process: a separate process doing
SELECT * FROM t_ser blocks until the first process exits (measured on
1.652, 1.655 and master).
This change also factors out code for releasing the lock into a separate
method that is used by DESTROY.
The version for DBD::File is bumped.
Assisted-By: Claude Mythos 5.1 <noreply@anthropic.com>
Signed-off-by: Robert Rothenberg <perl@rhizomnic.com>
robrwo
force-pushed
the
rrwo/fix-mldbm-lock
branch
from
October 17, 2026 11:43
6fa62b0 to
99bbf2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was a bug introduced by the fix for CVE-2026-78030.
The exception unwound DBI::DBD::SqlEngine::Table::new before the Table object was blessed, so no DESTROY ever releases the lock, while $meta (with the open, locked lockfh) stays cached in $dbh->{sql_meta}{t_ser}. The next open of the table opens a second descriptor on the same .lck and blocks in flock() -- forever, because the holder is the same process.
Why only the Gofer variant hung: in plain mode the DROP reuses the same $meta, so DBD::File's $meta->{lockfh} = $fh drops the old handle (and with it the lock) just before it calls flock. Under Gofer the DROP is served by a different server-side dbh with its own fresh $meta, so the stale handle is never replaced. The same thing happens without Gofer for any second handle or any second process: a separate process doing SELECT * FROM t_ser blocks until the first process exits (measured on 1.652, 1.655 and master).
This change also factors out code for releasing the lock into a separate method that is used by DESTROY.
The version for DBD::File is bumped.
Assisted-By: Claude Mythos 5.1 noreply@anthropic.com