Files
scylladb/utils
Piotr Dulikowski e059875217 Merge 'table_helper: fix use-after-free on prepared-statement invalidation' from Marcin Maliszkiewicz
insert() held no local strong ref to the prepared modification_statement
across the suspension in execute(). On a single shard:

1. Fiber A suspends inside _insert_stmt->execute().
2. DROP TABLE / DROP KEYSPACE on the target, or LRU eviction, removes
   the prepared_statements_cache entry, releasing its strong ref.
3. Fiber B re-enters cache_table_info(), sees _prepared_stmt
   (checked_weak_ptr) invalidated, and runs _insert_stmt = nullptr,
   releasing the last strong ref. The modification_statement is freed.
4. Fiber A resumes inside execute() and touches freed *this.

Pin strong ref to _insert_stmt locally before the suspension.

Fixes https://scylladb.atlassian.net/browse/SCYLLADB-1667

Backport: all supported branches, it's memory corruption bug, long present

Closes scylladb/scylladb#29588

* github.com:scylladb/scylladb:
  test/boost: add dummy case to table_helper_test for non-injection modes
  test/boost: add regression test for table_helper insert() UAF
  utils/error_injection: add waiters() API
  table_helper: fix use-after-free on prepared-statement invalidation

(cherry picked from commit efcc0b6376)

Closes scylladb/scylladb#29747

Closes scylladb/scylladb#29802

Closes scylladb/scylladb#29812

Closes scylladb/scylladb#29844
2026-05-12 18:10:32 +02:00
..
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00