)]}'
{
  "commit": "fc9c1a3ad753b618d0e90c6d801931f66fb3584e",
  "tree": "859a2a765f82ce68add1d906e5dcbbccb812cc81",
  "parents": [
    "6c236959898894b4356e1f8d69d9dfc7d3c432b9"
  ],
  "author": {
    "name": "Rudolf Polzer",
    "email": "rpolzer@google.com",
    "time": "Tue Apr 28 04:49:04 2026 -0700"
  },
  "committer": {
    "name": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "email": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Thu May 07 01:36:19 2026 -0700"
  },
  "message": "Fork detection: add rfork() and similar support for FreeBSD/OpenBSD.\n\nOn BSD systems, `pthread_atfork()` is insufficient, as e.g. `rfork()`\n(similar to Linux\u0027s `clone()`) can create processes too, and will not\ncall pthread\u0027s handlers. Use BSD\u0027s `minherit` mechanism to detect this\nkind of process duplication the same way as it works on Linux.\n\nThere would be similar problems if one were to use `vfork()` on some\nsystems. However, do note that according to POSIX.1, doing virtually\nanything in the `vfork()` child is undefined behavior, and we can\u0027t\nreasonably be expected to guard against undefined behavior in callers.\nmacOS even deprecated the function and shows a warning for any use of\nit.\n\nI believe this will not actually hit any real-world software, and am\nmerely adding this to be sure.\n\nManually tested on OpenBSD:\n\n```\ngrawp$ uname -a\nOpenBSD grawp.my.domain 7.1 GENERIC.MP#465 amd64\ngrawp$ ./crypto_test --gtest_filter\u003d\u0027*Fork*\u0027\nNote: Google Test filter \u003d *Fork*\n[\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d] Running 3 tests from 2 test suites.\n[----------] Global test environment set-up.\n[----------] 2 tests from ForkDetect\n[ RUN      ] ForkDetect.Test\n[       OK ] ForkDetect.Test (7 ms)\n[ RUN      ] ForkDetect.TestAlternate\n[       OK ] ForkDetect.TestAlternate (0 ms)\n[----------] 2 tests from ForkDetect (8 ms total)\n\n[----------] 1 test from RandTest\n[ RUN      ] RandTest.Fork\n[       OK ] RandTest.Fork (4 ms)\n[----------] 1 test from RandTest (4 ms total)\n\n[----------] Global test environment tear-down\n[\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d] 3 tests from 2 test suites ran. (13 ms total)\n[  PASSED  ] 3 tests.\n```\n\nand on FreeBSD:\n\n```\n[rpolzer@grawp build (git)-[d03c3135d]-]$ uname -a\nFreeBSD grawp 15.0-RELEASE-p6 FreeBSD 15.0-RELEASE-p6 releng/15.0-n281024-6b6bc9afa0b0 GENERIC amd64\n[rpolzer@grawp build (git)-[d03c3135d]-]$ ./crypto_test --gtest_filter\u003d\u0027*Fork*\u0027\nNote: Google Test filter \u003d *Fork*\n[\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d] Running 3 tests from 2 test suites.\n[----------] Global test environment set-up.\n[----------] 2 tests from ForkDetect\n[ RUN      ] ForkDetect.Test\n[       OK ] ForkDetect.Test (2 ms)\n[ RUN      ] ForkDetect.TestAlternate\n[       OK ] ForkDetect.TestAlternate (0 ms)\n[----------] 2 tests from ForkDetect (3 ms total)\n\n[----------] 1 test from RandTest\n[ RUN      ] RandTest.Fork\n[       OK ] RandTest.Fork (1 ms)\n[----------] 1 test from RandTest (1 ms total)\n\n[----------] Global test environment tear-down\n[\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d] 3 tests from 2 test suites ran. (5 ms total)\n[  PASSED  ] 3 tests.\n```\n\nTested on both that without this change, the added test fails.\n\nUpdate-Note: if you seriously sidestep the OS-level proper channels of\ncreating a new process duplicating address space, stop doing that, or at\nleast do not call BoringSSL from the so-forked process. In general, any\naddress space duplication shall be done using `fork()` and `fork()`\nonly.\n\nChange-Id: I11f0c3e868a36ca5a1ab8b605c40f9856a6a6964\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/94247\nCommit-Queue: Rudolf Polzer \u003crpolzer@google.com\u003e\nPresubmit-BoringSSL-Verified: boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com \u003cboringssl-scoped@luci-project-accounts.iam.gserviceaccount.com\u003e\nReviewed-by: David Benjamin \u003cdavidben@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c12464a6c5dc0d7ea810a559ea7f84c0bfcdf683",
      "old_mode": 33188,
      "old_path": "crypto/rand/fork_detect.cc",
      "new_id": "ecee4361111cfbdacc86dc364cda899a1aadb638",
      "new_mode": 33188,
      "new_path": "crypto/rand/fork_detect.cc"
    },
    {
      "type": "modify",
      "old_id": "565519b6f0f15c7d2a353861e084879ae477dd88",
      "old_mode": 33188,
      "old_path": "crypto/rand/fork_detect_test.cc",
      "new_id": "81bcb0daecbd9dff59fcaca471e5401be64a92b9",
      "new_mode": 33188,
      "new_path": "crypto/rand/fork_detect_test.cc"
    },
    {
      "type": "modify",
      "old_id": "9ed080f2a7e78297c0a3311ac286df3473cca795",
      "old_mode": 33188,
      "old_path": "crypto/rand/internal.h",
      "new_id": "50dbf0b015d04e51849dee7f0b84fd1eb0887119",
      "new_mode": 33188,
      "new_path": "crypto/rand/internal.h"
    }
  ]
}
