feat: replace b-prefixed Rust coreutils with BusyBox#234
Merged
Conversation
…uct stat Replace 14 hand-rolled Rust coreutils (bcat, bls, becho, etc.) with BusyBox 1.37.0 cross-compiled as a static musl binary. BusyBox provides cat, ls, head, tail, wc, grep, cp, mv, rm, mkdir, rmdir, echo, true, false, which, plus sed, awk, find, sort, vi, ash shell, and 40+ more utilities in a single ~1MB binary. Key changes: - Add scripts/build-busybox.sh for cross-compiling BusyBox (x86_64/aarch64) - Update ext2 disk script to install BusyBox with symlinks instead of b-prefixed binaries - Delete 14 Rust coreutil sources and their Cargo.toml [[bin]] entries - Update all test programs to reference unprefixed paths (/bin/cat vs /bin/bcat) - Fix aarch64 struct stat layout: x86_64 uses 144-byte layout while aarch64 uses 128-byte asm-generic layout with different field order (mode/nlink swapped) and widths (nlink u32, blksize i32). The mismatch caused a 16-byte stack buffer overflow corrupting saved x29/x30, resulting in INSTRUCTION_ABORT at ELR=0x0. - Fix ELF loader buffer overflow for non-page-aligned segments on both architectures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
struct statlayout — x86_64 uses a 144-byte layout while aarch64 uses a 128-byte asm-generic layout with different field order and widths. The mismatch caused a 16-byte stack buffer overflow corrupting saved x29/x30 registers, resulting inINSTRUCTION_ABORTatELR=0x0Test plan
🤖 Generated with Claude Code