)]}'
{
  "commit": "5d543dd1d0a21576df5c1dde0322c326a1e08d96",
  "tree": "578fde5a7a4f326b1efca107ba4c7ddacc5976c1",
  "parents": [
    "41a6e8c212c6d6cd2ae5abf77e8d3680c2801cfb"
  ],
  "author": {
    "name": "Laramie Leavitt",
    "email": "lar@google.com",
    "time": "Sun Nov 15 08:50:19 2026 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Nov 16 14:37:54 2026 -0800"
  },
  "message": "Make RandenPool fork-safe, avoid once_flag exception deadlock, and scrub seeds.\n\nPreviously, `GetEntropyFromRandenPool` initialized `shared_pools` once via\n`absl::call_once`. That design had three issues:\n\n1. `fork()` stream duplication and spinlock deadlock: If any caller seeded an\n   `absl::BitGen`, `absl::InsecureBitGen`, or `absl::MakeSeedSeq()` before\n   `fork()`, child processes inherited `pool_once` in the done state along with\n   up to 240 bytes per entry of buffered Randen state, causing forked children\n   to produce identical random sequences. Furthermore, if another thread in the\n   parent held `RandenPoolEntry::mu_` across `fork()`, the child process could\n   deadlock forever on a spinlock owned by a dead parent thread.\n2. `absl::call_once` exception deadlock: `absl::call_once` does not catch C++\n   exceptions, so throwing `absl::SeedGenException` inside `InitPoolURBG` when\n   OS entropy failed left `pool_once` permanently stuck in `kOnceRunning`,\n   deadlocking all concurrent and subsequent callers.\n3. Residual stack seed material: `InitPoolURBG` left the raw unpermuted OS seed\n   material on the stack after copying it into `RandenPoolEntry`.\n\nReplace `pool_once` and `shared_pools` with an atomic pointer to a\ngeneration-tagged `PoolArray` and an async-signal-safe `pthread_atfork` child\nhandler that increments an atomic generation counter:\n- Fast-path calls perform only a relaxed generation load and an acquire pointer\n  load with no extra synchronization.\n- Slow-path initialization is serialized via a `(generation, pid)`-tagged\n  `InitGate` so concurrent cold-start or post-fork callers perform a single OS\n  entropy read, a single `pthread_atfork()` registration, and a single\n  `PoolArray` allocation without ever touching a parent\u0027s inherited spinlock.\n- `pthread_atfork()` errors fail initialization (leaving `atfork_registered`\n  unset and throwing `SeedGenException`) rather than silently disabling fork\n  detection.\n- After `fork()`, children observe a generation mismatch and lazily allocate and\n  OS-seed a fresh `PoolArray` without touching inherited parent spinlocks; prior\n  `PoolArray` and `InitGate` generations remain linked via `prev` so leak\n  checkers continue to see them as reachable.\n- `SeedScrubber` zeroes stack `seed_material` via `volatile` stores on scope\n  exit, and `InitGate::mu` is unlocked before invoking `ThrowSeedGenException()`\n  so OS entropy failures never wedge concurrent or subsequent callers.\n\nPiperOrigin-RevId: 1022234714\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b2c3fa2f87e0eae4e2735f1faea538d21d6b616a",
      "old_mode": 33188,
      "old_path": "absl/random/CMakeLists.txt",
      "new_id": "089b5283b86676bf95c33f9311b0daeaa9b0c63f",
      "new_mode": 33188,
      "new_path": "absl/random/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "04f9a27c2b612d733cadb82f7b08a5f29d72e557",
      "old_mode": 33188,
      "old_path": "absl/random/internal/BUILD.bazel",
      "new_id": "766bc91b930bd0b32211d35e6b1b6fb5d6029454",
      "new_mode": 33188,
      "new_path": "absl/random/internal/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "21f83052362cb9bc89f8bfd823ee5210e1b04df4",
      "old_mode": 33188,
      "old_path": "absl/random/internal/entropy_pool.cc",
      "new_id": "6488ae69cac9d0f4abaca744774caa2855dc852b",
      "new_mode": 33188,
      "new_path": "absl/random/internal/entropy_pool.cc"
    },
    {
      "type": "modify",
      "old_id": "970ef8744cc663e12473a05cc62388ca809ced7f",
      "old_mode": 33188,
      "old_path": "absl/random/internal/entropy_pool.h",
      "new_id": "204ec89d1d092df8c9d826c5cabec1d2e2cf9f17",
      "new_mode": 33188,
      "new_path": "absl/random/internal/entropy_pool.h"
    },
    {
      "type": "modify",
      "old_id": "7739f19dfb68b84f4b2fc0086362735683feb18c",
      "old_mode": 33188,
      "old_path": "absl/random/internal/entropy_pool_test.cc",
      "new_id": "28d47aad13741e0f1958393fc211df9fae17d3eb",
      "new_mode": 33188,
      "new_path": "absl/random/internal/entropy_pool_test.cc"
    }
  ]
}
