[Important] Batch 校验缺少资源上限 #13
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
来源
Oracle 审核
docs/design.mdSection 3.2 WAL位置
Section 3.2 "WAL Batch 校验与重放"(~line 530)
问题描述
Recovery 校验
entryCount、entriesSize和 entry 边界,但未定义任何资源上限。恶意或损坏的 WAL 可能包含极大的entryCount或entriesSize,导致 recovery OOM 或无限循环。例如:
entryCount = 2^32 - 1但entriesSize也极大 → 尝试分配巨大 fragment buffer建议修复
在 Section 3.2 添加硬性限制(可配置,建议默认值):
Recovery 解析时,超过任何上限即视为 WAL 损坏。写入侧也必须遵守这些限制,超出拒绝写入。