Files
scylladb/utils
Piotr Dulikowski e4e1de5e3b 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
2026-05-11 15:04:29 +02:00
..
2025-08-31 11:37:39 +03:00
2025-01-14 07:56:39 -05:00
2025-07-08 10:38:23 +03:00
2025-04-01 00:07:28 +02:00
2025-04-01 00:07:28 +02:00
2026-02-04 09:41:36 +02:00
2025-09-01 14:58:21 +03:00
2025-09-28 04:27:33 +02:00
2025-08-28 23:31:04 +02:00
2025-04-01 00:07:28 +02:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00