Skip to content

fix: saturate/clamp latent attacker-derived arithmetic (parallel round-7)#128

Merged
kernalix7 merged 1 commit into
mainfrom
fix/latent-arithmetic-round7
Jun 11, 2026
Merged

fix: saturate/clamp latent attacker-derived arithmetic (parallel round-7)#128
kernalix7 merged 1 commit into
mainfrom
fix/latent-arithmetic-round7

Conversation

@kernalix7

Copy link
Copy Markdown
Owner

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_verity salt slice (file salt_len, no bound) -> .min(SALT_LEN)
  • futex_op_call FUTEX_WAKE_OP 1u32 << oparg (user 12-bit, >=32) -> checked_shl
  • cgroup_pressure PSI *10000/*window_us -> saturating_mul
  • overlayfs/fallocate offset+len/size/round-up -> saturating_add

Gate: clippy -p {kernel,vfs,syscall} ✓ + bare-metal kernel build ✓ + vfs/syscall build ✓ + fmt ✓. Conservative, no behaviour change for valid input.

…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.
@kernalix7 kernalix7 merged commit bafc6c8 into main Jun 11, 2026
2 checks passed
@kernalix7 kernalix7 deleted the fix/latent-arithmetic-round7 branch June 11, 2026 02:32
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.

1 participant