Skip to content

mask manager: fix use-after-free when selecting a group - #21861

Open
da-phil wants to merge 1 commit into
darktable-org:masterfrom
da-phil:pl/fix_use_after_free_in_mask_manager
Open

mask manager: fix use-after-free when selecting a group#21861
da-phil wants to merge 1 commit into
darktable-org:masterfrom
da-phil:pl/fix_use_after_free_in_mask_manager

Conversation

@da-phil

@da-phil da-phil commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Tree rows keep raw dt_iop_module_t pointers, but modules are freed on image change and on darkroom leave. The structure-hash early-out in gui_update can keep a store built for the previous set of modules, so selecting a group row called flags() through a dangling pointer and segfaulted.

Drop dead modules in _lib_masks_get_values() and invalidate the cached tree hash on image change and darkroom entry.

Fixes: #21852

Disclaimer: this work has been co-created with Claude.

Tree rows keep raw dt_iop_module_t pointers, but modules are freed on image
change and on darkroom leave. The structure-hash early-out in gui_update can
keep a store built for the previous set of modules, so selecting a group row
called flags() through a dangling pointer and segfaulted.

Drop dead modules in _lib_masks_get_values() and invalidate the cached tree
hash on image change and darkroom entry.
@da-phil da-phil mentioned this pull request Aug 15, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segfault opening mask group

1 participant