Repository navigation
Free frames on task-creation failure; no panic on user PDPT OOM - #188
Merged
Merged
Conversation
…ation fails - task_create_user_argv(): the argv-does-not-fit branch released only the slot, leaking the guard page, kernel and user stacks, user guard page and PDPT (24 frames, measured). It now calls task_free_resources() first. - pae_create_user_pdpt(): a failed PDPT or PD allocation called kernel_panic(). It runs for every exec/spawn, not just at boot, so memory exhaustion by any user became a kernel DoS. It now frees what it took and returns 0; every caller already handles 0. verify/verify-memory-fixes.sh forces both paths through a TINYOS_FAULT_INJECT kernel-shell command (memunwind) and measures free frames across each failed creation. Unfixed: argv-nofit deltas -24 -24 -24, then KERNEL PANIC on the PDPT leg. Fixed: all deltas 0, PASS. Co-Authored-By: Claude Opus 5.5 <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.
Sixth of the seven fix PRs.
Fixes
task_create_user_argv()released only the slot on this branch, leaking the guard page, 8 kernel stack pages, the user guard page, the user stack and the PDPT (24 frames per failure, measured). It now callstask_free_resources()before freeing the slot.pae_create_user_pdpt()calledkernel_panic()when a PDPT/PD allocation failed. The "boot-critical" comment was wrong: it runs on every exec/spawn, so a user who could exhaust memory could crash the kernel. It now frees partial allocations and returns 0. All three callers already handle 0.Witness
verify/verify-memory-fixes.shbuilds with-DTINYOS_FAULT_INJECT(and runsmake cleanon exit). It runs the hidden kernel-shell commandmemunwind, which forces three failures and checkspmm_free_frames()across each one, 3 tries per leg:Each leg also reports whether its fault actually fired; if one didn't, the result is INCONCLUSIVE, not PASS.
Unfixed:
RESULT: FAIL — 2 assertion(s). Fixed:RESULT: PASS.🤖 Generated with Claude Code