Skip to content

fix(rboot): config parser must never brick boot - #673

Merged
Pryancito merged 1 commit into
masterfrom
claude/labwc-eclipse-desktop-08f1ft
Jul 28, 2026
Merged

fix(rboot): config parser must never brick boot#673
Pryancito merged 1 commit into
masterfrom
claude/labwc-eclipse-desktop-08f1ft

Conversation

@Pryancito

Copy link
Copy Markdown
Owner

Real-hardware report: a mixed ESP (new rboot.conf with resolution=auto, old BootX64.efi without auto support) died before drawing anything -- panicked at src/config.rs:66: ParseIntError { kind: InvalidDigit } -- because the resolution parser unwrapped "auto".parse::<usize>(). The config file is user-editable and version-skewed in practice, so the parser must degrade, not panic.

Hardened every value parser in rboot's config:

  • resolution: malformed/unknown values warn and fall back to Auto (which itself falls back to keeping the current mode when EDID/GOP give nothing).
  • kernel_stack_address / kernel_stack_size / physical_memory_offset: malformed numbers warn and keep the built-in default. The hex parser also no longer slices &value[2..] blind (out-of-bounds panic on short values) and accepts values with or without the 0x prefix.

Verified: rboot builds, fmt/clippy clean; QEMU boots to the shell at the auto-selected 1920x1080 with the hardened binary.

Claude-Session: https://claude.ai/code/session_01MHCn5RNRcwR5PY1sYBHY2S

Real-hardware report: a mixed ESP (new rboot.conf with `resolution=auto`, old
BootX64.efi without auto support) died before drawing anything --
`panicked at src/config.rs:66: ParseIntError { kind: InvalidDigit }` -- because
the resolution parser unwrapped `"auto".parse::<usize>()`. The config file is
user-editable and version-skewed in practice, so the parser must degrade, not
panic.

Hardened every value parser in rboot's config:
- resolution: malformed/unknown values warn and fall back to Auto (which
  itself falls back to keeping the current mode when EDID/GOP give nothing).
- kernel_stack_address / kernel_stack_size / physical_memory_offset:
  malformed numbers warn and keep the built-in default. The hex parser also
  no longer slices `&value[2..]` blind (out-of-bounds panic on short values)
  and accepts values with or without the 0x prefix.

Verified: rboot builds, fmt/clippy clean; QEMU boots to the shell at the
auto-selected 1920x1080 with the hardened binary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MHCn5RNRcwR5PY1sYBHY2S
@Pryancito
Pryancito merged commit 8464932 into master Jul 28, 2026
2 of 14 checks passed
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