Skip to content

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #26482

Redpada store `model::record_batch` records as opaque bytes. The bytes
are materialized to individual `model::record` lazily when iterating
over the batch records. During the record materialization record header
vector is parsed. The vector size is stored in a variable length encoded
integer. If the data in the record buffer are invalid the size may be
incorrectly deserialized leading to a very large allocation. Added basic
defensive check that compares the requested vector size with the number
of bytes left in the buffer. It the size is greater then the exception
is thrown as we know that header is never smaller than one byte.

Signed-off-by: Michał Maślanka <[email protected]>
(cherry picked from commit 7f109db)
@vbotbuildovich vbotbuildovich added this to the v25.1.x-next milestone Jun 17, 2025
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jun 17, 2025
@piyushredpanda
Copy link
Contributor

/ci-repeat 1

@piyushredpanda
Copy link
Contributor

/dt

@vbotbuildovich
Copy link
Collaborator Author

CI test results

test results on build#67524
test_class test_method test_arguments test_kind job_url test_status passed reason
distributed_kv_stm_tests_rpunit distributed_kv_stm_tests_rpunit unit https://buildkite.com/redpanda/redpanda/builds/67524#019780d5-dec2-412e-8d92-10f5965da95d FLAKY 1/2

@mmaslankaprv mmaslankaprv merged commit a681b6f into redpanda-data:v25.1.x Jun 18, 2025
17 checks passed
@piyushredpanda piyushredpanda modified the milestones: v25.1.x-next, v25.1.9 Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants