Skip to content

Fix realloc moving sampled partition-1 allocations into partition 0. - #1981

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1030416609
Dec 2, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_1030416609

Conversation

@copybara-service

Copy link
Copy Markdown

Fix realloc moving sampled partition-1 allocations into partition 0.

Bug: under kFull heap partitioning, realloc() of a sampled allocation from
security partition 1 placed the new block in partition 0, so the contents
crossed the security-partition boundary.

Cause: sampled allocations of security partition 1 are tagged
kSampledOrColdP1 (today the only allocations with that tag), but
PartitionFromPointer() mapped that tag to partition 0. realloc() always
reallocates sampled allocations and uses PartitionFromPointer() to pick the
partition of the new block.

Fix: map kSampledOrColdP1 to partition 1. partitioning_test now reallocs
sampled allocations of both partitions and checks that each new block stays
in its original partition.

@google-cla

google-cla Bot commented Nov 30, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Bug: under kFull heap partitioning, realloc() of a sampled allocation from
security partition 1 placed the new block in partition 0, so the contents
crossed the security-partition boundary.

Cause: sampled allocations of security partition 1 are tagged
kSampledOrColdP1 (today the only allocations with that tag), but
PartitionFromPointer() mapped that tag to partition 0. realloc() always
reallocates sampled allocations and uses PartitionFromPointer() to pick the
partition of the new block.

Fix: map kSampledOrColdP1 to partition 1. partitioning_test now reallocs
sampled allocations of both partitions and checks that each new block stays
in its original partition.
PiperOrigin-RevId: 1034090513
@copybara-service
copybara-service Bot merged commit f3e085d into master Dec 2, 2026
14 of 15 checks passed
@copybara-service
copybara-service Bot deleted the test_1030416609 branch December 2, 2026 05:00

This branch was successfully deployed

1 active deployment
github-pages — f3e085da Deployed Dec 2, 2026 by github-pages[bot] via deploy #3327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants