Skip to content

squid: rgw/beast: use strand executor for timeout timer to prevent concurrent socket access - #68507

Merged
neha-ojha merged 1 commit into
ceph:squidfrom
BBoozmen:wip-76150-squid
Jun 24, 2026
Merged

neha-ojha merged 1 commit into
ceph:squidfrom
BBoozmen:wip-76150-squid

Conversation

@BBoozmen

Copy link
Copy Markdown
Contributor

…t socket access

The timeout_timer in AsioFrontend::on_accept() was constructed with
context.get_executor(), which dispatches the timeout handler to the
raw io_context. Since each connection's coroutine runs on a strand
(via make_strand(context)), this allowed the timeout handler to
execute concurrently with the coroutine on a different thread.

When the timeout fires, timeout_handler calls socket.cancel() and
socket.shutdown() racing with the coroutine's async_read_header(),
async_write(), or async_read_some() on the same socket and buffer.
This can corrupt the flat_static_buffer's internal pointers, leading
to SIGSEGV in the Beast HTTP parser.

Fix by constructing the timeout_timer with yield.get_executor(),
which returns the coroutine's strand executor. This ensures the
timeout handler is serialized with the coroutine, preventing
concurrent access to the socket and buffer.

Fixes: https://tracker.ceph.com/issues/75031
Signed-off-by: Oguzhan Ozmen <[email protected]>
(cherry picked from commit 86ad0b8)
@BBoozmen
BBoozmen requested a review from a team as a code owner April 21, 2026 13:54
@BBoozmen BBoozmen added this to the squid milestone Apr 21, 2026
@github-actions github-actions Bot added the rgw label Apr 21, 2026
@cbodley cbodley changed the title squid: null squid: rgw/beast: use strand executor for timeout timer to prevent concurrent socket access Apr 21, 2026
@batrick batrick added the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
@github-actions github-actions Bot added releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-fail Release engineering: failed backport verification audit. labels May 14, 2026
@anrao19

anrao19 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

pr testing completed and approved by @ivancich , more details In : https://tracker.ceph.com/issues/76715
@BBoozmen , if no further testing needed then pr can be merged

@anrao19

anrao19 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

jenkins test api

@neha-ojha
neha-ojha merged commit 430df0e into ceph:squid Jun 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa ready-to-merge releng-audit-pass Release engineering: passed backport verification audit. rgw TESTED

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants