Skip to content

verify: fix segfault in timedout teardown - #2081

Merged
axboe merged 1 commit into
axboe:masterfrom
minwooim:fix-trigger-timeout-segfault
Apr 22, 2026
Merged

axboe merged 1 commit into
axboe:masterfrom
minwooim:fix-trigger-timeout-segfault

Conversation

@minwooim

Copy link
Copy Markdown
Contributor

Fix segfault happening in the teardown caseud by --trigger-timeout= option regardless to the --verify= and --verify_state_save= options.

td->inflight_numberio array is allocated in init_inflight_logging() only if td->o.verify != VERIFY_NONE && td->o.verify_state_save. But, in case where those two options are not given and --trigger-timeout= is given and the timer is expired, verify state is attempted to be saved. In this case, td->inflight_numberio array is NULL causing the segfault. This patch fixed the segfault by checking td->inflight_numberio before assigning them to the state.

This can be reproduced with --trigger-timeout= where the device ignores the incoming commands by not issuig the completion simply with QEMU; dm-flakey does not support to ignore the completion itself yet.

Fix segfault happening in the teardown caseud by `--trigger-timeout=`
option regardless to the --verify= and --verify_state_save= options.

`td->inflight_numberio` array is allocated in `init_inflight_logging()`
only if ``td->o.verify != VERIFY_NONE && td->o.verify_state_save``.
But, in case where those two options are not given and
--trigger-timeout= is given and the timer is expired, verify state is
attempted to be saved.  In this case, `td->inflight_numberio` array is
NULL causing the segfault.  This patch fixed the segfault by checking
`td->inflight_numberio` before assigning them to the state.

This can be reproduced with --trigger-timeout= where the device ignores
the incoming commands by not issuig the completion simply with QEMU;
dm-flakey does not support to ignore the completion itself yet.

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
@axboe
axboe merged commit 5a60411 into axboe:master Apr 22, 2026
17 checks passed
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.

2 participants