Skip to content

CID 1518613: Traffic Dump: fix a use after free of a mutex#10521

Merged
bneradt merged 1 commit intoapache:masterfrom
bneradt:fix_traffic_dump_uninitialized_lock_use
Sep 27, 2023
Merged

CID 1518613: Traffic Dump: fix a use after free of a mutex#10521
bneradt merged 1 commit intoapache:masterfrom
bneradt:fix_traffic_dump_uninitialized_lock_use

Conversation

@bneradt
Copy link
Contributor

@bneradt bneradt commented Sep 25, 2023

Coverity found that Traffic Dump had code that locked a mutex via std::lock_guard, freed the owner of the mutex (and thus the mutex), and then, when the std::lock_guard went out of scope, unlocked the free'd mutex. This use after free is addressed in this patch by extending the lifetime of the SessionData object owning the mutex until after the lock is released.

Fixes: #10331


For Reviewers

This patch is easier to read if configured to ignore white space.

Coverity found that Traffic Dump had code that locked a mutex via
std::lock_guard, freed the owner of the mutex (and thus the mutex), and
then, when the std::lock_guard went out of scope, unlocked the free'd
mutex. This use after free is addressed in this patch by extending the
lifetime of the SessionData object owning the mutex until after the lock
is released.

Fixes: apache#10331
@bneradt bneradt added this to the 10.0.0 milestone Sep 25, 2023
@bneradt bneradt self-assigned this Sep 25, 2023
@bryancall bryancall requested review from cmcfarlen and moonchen and removed request for moonchen September 25, 2023 22:04
@bneradt bneradt merged commit 43c58a3 into apache:master Sep 27, 2023
@bneradt bneradt deleted the fix_traffic_dump_uninitialized_lock_use branch September 27, 2023 00:46
@zwoop
Copy link
Contributor

zwoop commented Oct 16, 2023

@bneradt This gets merge conflicts because this plugin has moved on master. If you want this on 9.2.x, please make another branch PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CID 1518613: Uninitialized lock use

4 participants