Skip to content

Bounded WAL segment size before allocation - #353

Open
walsykerem wants to merge 3 commits into
ClickHouse:mainfrom
walsykerem:wal-size-problem
Open

walsykerem wants to merge 3 commits into
ClickHouse:mainfrom
walsykerem:wal-size-problem

Conversation

@walsykerem

@walsykerem walsykerem commented Nov 25, 2026 •

Copy link
Copy Markdown

Bounded WAL segment size before allocation

Untrusted xlp_seg_size flowed into Vec::resize. A 36 byte file claiming 2 GiB forced a multi gigabyte allocation, and an 8 KiB file produced 64 MiB of output.

Fix: reject sizes above the 16 MiB project cap, require a power of two and an input no larger than the claimed size, all before allocating.

Tested against the original reproduction with no amplification. Migrated into the main project; valid segments still pass and no regressions detected.

@cla-assistant

cla-assistant Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ walsykerem
❌ Kerem


Kerem seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@serprex serprex closed this Nov 26, 2026
@serprex serprex reopened this Nov 26, 2026
@walsykerem

Copy link
Copy Markdown
Author

Hey team, since I sent the commit from my local setup (Kerem im), I'm showing up twice (as both my local user/IP and my GitHub account walsykerem). Can we adjust the workflow to fix this? @serprex

@serprex

serprex commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

I'll raise it, but easiest would be to squash under your gh account

maybe you could sign the commits instead but that might be a pain

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.

2 participants