gpt_read stops reading the entries at max, and leaves the rest unchecked #180

Open
opened 2026-11-11 21:34:00 +00:00 by rajames · 0 comments
Owner

Found

kernel/src/gpt.c:127 for (i = 0; i < nent && n < max; i++): once max used entries are read, the rest are neither listed nor range-checked. sk_v4_mint_zuse passes 4. A foreign disk whose StarshipOS partition is past the first max used entries reads as having none. Harmless for this system's own sticks (one or two partitions).

Done when

  • Every entry range-checked; a disk with more used entries than max reported, not silently cut

🤖 Filed with Claude Code -- the code review of 2026-11-11, at 4d42d25c (Captain Bob, 2026-11-11: "File the review findings as issues"). Read, not run: each is to be confirmed by a test written first and seen to fail.

### Found `kernel/src/gpt.c:127` `for (i = 0; i < nent && n < max; i++)`: once `max` used entries are read, the rest are neither listed nor range-checked. `sk_v4_mint_zuse` passes 4. A foreign disk whose StarshipOS partition is past the first `max` used entries reads as having none. Harmless for this system's own sticks (one or two partitions). ### Done when - [ ] Every entry range-checked; a disk with more used entries than `max` reported, not silently cut 🤖 Filed with [Claude Code](https://claude.com/claude-code) -- the code review of 2026-11-11, at `4d42d25c` (Captain Bob, 2026-11-11: "File the review findings as issues"). Read, not run: each is to be confirmed by a test written first and seen to fail.
rajames added the
kind
bug
area/kernel
priority
nice
status
backlog
labels 2026-11-11 21:34:01 +00:00
Sign in to join this conversation.