Skip to content

Cherry pick #115222 to 25.8: Bound text index posting list deserialization - #116306

Closed
robot-ch-test-poll4 wants to merge 2 commits into
backport/25.8/115222from
cherrypick/25.8/115222
Closed

robot-ch-test-poll4 wants to merge 2 commits into
backport/25.8/115222from
cherrypick/25.8/115222

Conversation

@robot-ch-test-poll4

Copy link
Copy Markdown
Contributor

Original pull-request #115222

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

CurtizJ and others added 2 commits August 17, 2026 22:54
`PostingListCodecNone::decode` handed the payload to `PostingList::read`, which
wraps `roaring_bitmap_portable_deserialize` and trusts the container headers
found inside that payload. A container claiming more values than the declared
size holds made the deserializer read past the end of the buffer and return the
leaked bytes as row ids, so a corrupted or forged text index file - for example
one delivered by `RESTORE TABLE` - turned into a heap out-of-bounds read of up
to ~24 KiB per query.

Use `PostingList::readSafe`, which bounds every container read by the declared
size, as `DeleteBitmap`, `AggregateFunctionGroupBitmapData` and
`PuffinBlockInputFormat` already do. It is free: croaring's `read` is
`readSafe` with `maxbytes = SIZE_MAX`.

ClickHouse/clickhouse-private#69184

Co-Authored-By: Claude Opus 5 <[email protected]>
Bound text index posting list deserialization
@robot-ch-test-poll4 robot-ch-test-poll4 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default labels Aug 25, 2026
@CurtizJ CurtizJ closed this Aug 25, 2026
@maxknv
maxknv deleted the cherrypick/25.8/115222 branch November 13, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants