Commit 151b8a8
fix(block-buffer-manager): drop redundant epoch-change pre-check
The early is_epoch_change() check in get_ordered_blocks read buffer_state
outside the mutex. If buffer_state flipped to EpochChange between the
unlocked check and the subsequent mutex acquire, the in-lock recheck (at
the start of the loop) would catch it and return the same error — so the
pre-check was redundant and only widened the TOCTOU window for analysis.
Removing it doesn't change behavior (caller still hits the in-lock check
before any state read) and reduces the surface area of audit-flagged
synchronization concerns around the dual AtomicU8 + Mutex design.
Refs: Galxe/gravity-audit#522
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1165b76 commit 151b8a8
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
609 | | - | |
610 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
611 | 613 | | |
612 | 614 | | |
613 | 615 | | |
| |||
0 commit comments