fix: saturate/clamp latent attacker-derived arithmetic (parallel round-7)#128
Merged
Conversation
…d-7) Defensive hardening of unwired exported APIs found by a parallel multi-engine sweep (Codex + dynamic-workflow lanes), each verified to be latent (no wired syscall/dispatch path today) but a genuine overflow/OOB that would panic under overflow-checks if wired: - dm_verity.rs: VerityHashTree salt slice self.salt[..salt_len] (file- derived salt_len, no <=SALT_LEN bound) -> clamp .min(SALT_LEN) (OOB). - futex_op_call.rs: FUTEX_WAKE_OP '1u32 << oparg' (12-bit user oparg, >=32 panics) -> checked_shl().unwrap_or(0). - cgroup_pressure.rs: PSI 'accum_us*10000', 'threshold*window_us', 'deltas[i]*10000' -> saturating_mul. - overlayfs.rs / fallocate.rs: 'offset + data.len()' / extent offset+len / size+len / block round-up -> saturating_add. All conservative; siblings already use the same pattern. No behaviour change for valid input.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defensive hardening of unwired exported APIs found by a parallel multi-engine sweep (Codex + workflow lanes), each adversarially verified latent but a genuine overflow/OOB that would panic if wired:
dm_veritysalt slice (file salt_len, no bound) ->.min(SALT_LEN)futex_op_callFUTEX_WAKE_OP1u32 << oparg(user 12-bit, >=32) ->checked_shlcgroup_pressurePSI*10000/*window_us->saturating_muloverlayfs/fallocateoffset+len/size/round-up ->saturating_addGate: clippy -p {kernel,vfs,syscall} ✓ + bare-metal kernel build ✓ + vfs/syscall build ✓ + fmt ✓. Conservative, no behaviour change for valid input.