commit | 782270b5d11fa58c34798a19159d544a077316fe | [log] [tgz] |
---|---|---|
author | Aaron Green <aarongreen@pigweed.infra.roller.google.com> | Thu Oct 17 18:27:18 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Oct 17 18:27:18 2024 +0000 |
tree | 49d119fe1d3949a464c28dd72a01d3938db964a0 | |
parent | fdb0f444e933a41dce85d4b0fdd8a0c227856ef6 [diff] |
roll: pigweed pw_allocator: Fix data race Prior to this CL, a corruption existed in the following scenario: - Block 1 is allocated. - Block 2 is allocated with an alignment requirement that results in a small gap of less than a minimumu-sized block between blocks 1 and 2. The extra bytes are added to the end of block 1. - Block 1 is resized to be slightly bigger by less than the extra bytes. Since the block size does not change, `Resize` trivially returns. - Block 2 is freed, and reclaims the bytes it lent to block 1. - Block 1 tries to access its trailing bytes concurrently with a new block being allocated. The fix is simply to update the tracked number of extra bytes, even when the `Resize` is trivial. Original-Bug: 372446436 Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/242736 Original-Revision: 57183dee645126c67dcccbb479c730492ef168f6 Rolled-Repo: https://pigweed.googlesource.com/pigweed/pigweed Rolled-Commits: 8e0d91c3f7da31..57183dee645126 Roll-Count: 1 Roller-URL: https://ci.chromium.org/b/8733807452911354513 GitWatcher: ignore CQ-Do-Not-Cancel-Tryjobs: true Change-Id: I3618f92df81a9f4a144461b8bd7b66fe126830c9 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/showcase/sense/+/242922 Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Commit-Queue: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com> Bot-Commit: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
git clone https://pigweed.googlesource.com/pigweed/showcase/sense
Welcome to Pigweed Sense, a tour of key Pigweed components experienced through an imagined air quality product.
Please visit Sense: An interactive tour through Pigweed to get started.