)]}'
{
  "commit": "dd5219451c3ce26221762a15d867edf43b463bb2",
  "tree": "2e445a0c1919b0e27e3d38361841b83b935d0f21",
  "parents": [
    "2eaf07075ac15491c35e1ba1e836797fa81eb96b"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Sun Jan 08 18:49:42 2023 -0800"
  },
  "committer": {
    "name": "Boringssl LUCI CQ",
    "email": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Tue May 16 21:55:13 2023 +0000"
  },
  "message": "Fix RAND_enable_fork_unsafe_buffering when called after fork\n\nIf a process calls fork(), then the child process never forks again, the\nchild may wish to call RAND_enable_fork_unsafe_buffering(). However,\ndoing so exposes a bug: we assume that, if the flag is set, we don\u0027t\nneed to worry about fork-safety. But it is possible that the PRNG state\nwas cloned from another process which does not work.\n\nConcretely, consider a zygote process, e.g. Chromium\u0027s. A zygote process\nwould retain fork-safety, but pass along its PRNG state to each of its\nchildren. If the children never fork, they might disable fork-safety,\nhitting this bug. (Chromium does not call this API. This is just a\nhypothetical scenario.)\n\nFix this by reseeding whenever the fork-safety bit changes. This fix\ndoes not strictly depend on the atomics work, but it causes us to\nunconditionally sample rand_fork_unsafe_buffering_enabled(). This no\nlonger causes contention because it\u0027s just another atomic load.\n\nThis only affects systems without MADV_WIPEONFORK and without fast\nRDRAND. If RDRAND is fast, we\u0027re always fork-safe and MADV_WIPEONFORK\nallows us to efficiently detect forks.\n\nCq-Include-Trybots: luci.boringssl.try:linux_clang_rel_tsan\nChange-Id: I6d0c471c62c951254faf85420a7dc3f4a9d65ee0\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/59850\nCommit-Queue: David Benjamin \u003cdavidben@google.com\u003e\nReviewed-by: Adam Langley \u003cagl@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bf6b0469fd5b8ddcdcf648414f0004ad06a8e40a",
      "old_mode": 33188,
      "old_path": "crypto/fipsmodule/rand/rand.c",
      "new_id": "a3fc6880d3eec6380bbee7d5b66f943494868b6a",
      "new_mode": 33188,
      "new_path": "crypto/fipsmodule/rand/rand.c"
    },
    {
      "type": "modify",
      "old_id": "2ed1deb417bbd9410b0a0217295fd49af8a24fc7",
      "old_mode": 33188,
      "old_path": "crypto/rand_extra/rand_test.cc",
      "new_id": "1af28b04a646b1041fcf81c6f3215a2f1d30be37",
      "new_mode": 33188,
      "new_path": "crypto/rand_extra/rand_test.cc"
    }
  ]
}
