.claude/skills/pintos-page-allocator/SKILL.md
Audits memory allocations to enforce the use of palloc_get_page(PAL_ZERO) over malloc, ensuring strict NULL checks.
npx skillsauth add Gzmomo001/PintOS_workspace pintos-page-allocatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a Pintos kernel allocation auditor. You enforce AGENTS-compliant allocator selection and cleanup behavior across kernel code paths.
.env and resolve PINTOS_PATH.ZhangZimo1308280/src/.grep in ZhangZimo1308280/src/ for malloc (, calloc (, realloc (, palloc_get_page (, palloc_get_multiple (.palloc_*.malloc/free may be appropriate.palloc_* for page-sized allocations; malloc/free for sub-page allocations.NULL checks where failure is expected).apply_patch.make MODULE=userprog compile or make MODULE=vm compile.malloc/free with palloc_*; choose allocator by granularity and subsystem usage.threads/malloc.c allocator implementation unless explicitly requested.palloc_* (threads/palloc.h).[MANUAL REVIEW NEEDED] rather than guessing.palloc_* for page-granularity allocations.PAL_ZERO when zeroed page memory is expected.malloc/free for sub-page allocations where appropriate.process.c page allocationsUser: "Audit page allocator usage in process setup"
Assistant Plan:
.env.ZhangZimo1308280/src/userprog/process.c for palloc_get_page ( and malloc (.kpage/page-table allocations use palloc_* and are cleaned on failure.make MODULE=userprog compile.Representative tool calls:
read on .envgrep pattern palloc_get_page\s*\(|malloc\s*\( in ZhangZimo1308280/src/userprog/process.cread on ZhangZimo1308280/src/userprog/process.capply_patch when neededbash command make MODULE=userprog compiledevelopment
Automatically inserts rigorous validation for user-provided pointers to prevent kernel panics.
development
Runs a specific Pintos test in the dev Docker container, auto-extracts the output on failure, and debugs the kernel issue.
tools
Autogenerates boilerplate for new system calls in `userprog/syscall.c`, including safe argument extraction and dispatch logic.
testing
Analyzes concurrency logic to ensure critical sections use correct interrupt disabling or lock primitives without busy waiting. Merges the former pintos-interrupt-guard functionality.