libc: zero stat fields the kernel does not report#931
Closed
brandonpayton wants to merge 1 commit into
Closed
Conversation
This was referenced Jul 13, 2026
Phase B-1 matrix build status —
|
| Package | Arch | Status | Sha |
|---|---|---|---|
| icu | wasm32 | built | 597909e9 |
| libcurl | wasm32 | built | 4c8563da |
| libcxx | wasm32 | built | d4d73697 |
| libcxx | wasm64 | built | e5c7a35a |
| libiconv | wasm32 | built | a2e4479a |
| libpng | wasm32 | built | b2c247ba |
| libxml2 | wasm32 | built | c7c447be |
| libzip | wasm32 | built | 93f64079 |
| openssl | wasm32 | built | 7eb39510 |
| openssl | wasm64 | built | 55f7f2e1 |
| sqlite | wasm32 | built | 532ea231 |
| sqlite | wasm64 | built | 66859ff4 |
| zlib | wasm32 | built | 76d2ba71 |
| zlib | wasm64 | built | 0f0ed605 |
| bc | wasm32 | built | 54295528 |
| bzip2 | wasm32 | built | ae4ff490 |
| coreutils | wasm32 | built | a744cccd |
| curl | wasm32 | built | 7e64cad4 |
| dash | wasm32 | built | 219bd1fc |
| diffutils | wasm32 | built | 85768b7a |
| dinit | wasm32 | built | 5645a064 |
| fbdoom | wasm32 | built | 60fab3c5 |
| file | wasm32 | built | 64f09e5a |
| findutils | wasm32 | built | 304bca9a |
| gawk | wasm32 | built | aabf6e3d |
| git | wasm32 | built | c83f1100 |
| grep | wasm32 | built | 033701d7 |
| gzip | wasm32 | built | 228e00c4 |
| hello | wasm32 | built | a9c97de2 |
| kandelo-sdk | wasm32 | built | 4f18529e |
| kernel | wasm32 | built | 0f97e289 |
| less | wasm32 | built | 7f55ef5d |
| lsof | wasm32 | built | 424fce40 |
| m4 | wasm32 | built | 4bb05c73 |
| make | wasm32 | built | 50f15e01 |
| mariadb | wasm32 | built | f3d6b0c1 |
| mariadb | wasm64 | built | 8d6fb52b |
| modeset | wasm32 | built | 985e5b34 |
| msmtpd | wasm32 | built | 6d230c78 |
| nano | wasm32 | built | f4895435 |
| ncurses | wasm32 | built | e49944d6 |
| netcat | wasm32 | built | 0b31c929 |
| nginx | wasm32 | built | 237ced73 |
| php | wasm32 | built | 95b56839 |
| posix-utils-lite | wasm32 | built | d33b0f56 |
| ruby | wasm32 | built | 3f14ed28 |
| sed | wasm32 | built | 2b4359f1 |
| spidermonkey | wasm32 | built | b9be1e7d |
| tar | wasm32 | built | 9606a07c |
| tcl | wasm32 | built | 29034860 |
| unzip | wasm32 | built | 4dd311bd |
| userspace | wasm32 | built | 700ab731 |
| vim | wasm32 | built | 554d5be2 |
| wget | wasm32 | built | 0c0a53ae |
| xz | wasm32 | built | 18fda993 |
| zip | wasm32 | built | d8a86605 |
| zstd | wasm32 | built | e4b4e772 |
| bash | wasm32 | built | 870ec43e |
| mariadb-test | wasm32 | built | 50dfbbdd |
| mariadb-vfs | wasm32 | built | 60b01725 |
| mariadb-vfs | wasm64 | built | 36e1c9d4 |
| nethack | wasm32 | built | 765817ec |
| node | wasm32 | built | 72d6a54e |
| spidermonkey-node | wasm32 | built | 37bcba74 |
| vim-browser-bundle | wasm32 | built | 5df8c816 |
| nethack-browser-bundle | wasm32 | built | a0e0a234 |
| rootfs | wasm32 | built | 585a598e |
| shell | wasm32 | built | b78ec354 |
| lamp | wasm32 | built | 49d477ad |
| node-vfs | wasm32 | built | 664580bf |
| wordpress | wasm32 | built | 08d577dc |
Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.
Member
Author
|
Closing this focused source PR because its zero-initialization of unreported |
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.
What changed
#907 already landed the mmap and munmap fixes from the old #769 stack and established the current ABI 39 baseline. This PR does not replay that work.
Kandelo's ABI 39
WasmStatends at 88 bytes. musl's target-specificstruct kstatappendsst_rdev,st_blksize, andst_blocks, but the kernel does not write those fields.fstatat()previously copied whatever happened to be on the stack intostruct stat.This PR:
struct kstatbefore the syscall;fstat(),stat(), andlstat()after poisoning the stack;What was deliberately removed
I did not carry over #769's proposed
st_blksize = 4096orst_blocks = ceil(st_size / 512)synthesis. That calculation is wrong for sparse files because logical size is not allocated storage. I also did not carry over any SQLite patches or harness changes.#928 tracks the proper follow-up: collect truthful block and device metadata from each filesystem backend and treat the wire-format work as ABI-changing until audited.
ABI and package artifacts
There is no ABI layout or syscall-marshalling change here.
ABI_VERSIONstays at 39, and the committed snapshot and generated host bindings are unchanged.There are no package revision, binary-index, or VFS-image changes. Existing static packages remain ABI-compatible; they need an ordinary libc/package rebuild to receive this hardening. No prebuilt package artifacts are published by this PR.
Validation
Run through
scripts/dev-shell.sh:st_rdev;/bin/sh, and all 3 passed after building current dash;Hosted staging CI at head
c6f4977f3ea2c6bd909e4daaf3f6fbb01c7ca716also passed:Not run locally: manual browser verification, the browser test suite, SQLite
sort2, package image rebuilds, or performance benchmarks. The hosted browser suite did run and pass. This PR does not change host runtime, browser adapters, VFS allocation, package recipes, or the ABI, and it makes no performance claim.