Skip to content

fix(vfs): size pts-index digit buffer for the full u32 range#130

Merged
kernalix7 merged 1 commit into
mainfrom
fix/devpts-pty-digit-buffer-oob
Jun 23, 2026
Merged

fix(vfs): size pts-index digit buffer for the full u32 range#130
kernalix7 merged 1 commit into
mainfrom
fix/devpts-pty-digit-buffer-oob

Conversation

@kernalix7

Copy link
Copy Markdown
Owner

devpts/pty rendered a u32 pts index into a 5-byte [u8; 5] digit buffer (digits[dcount] in a while n>0 loop). An index >= 100000 (u32 bounded only by configurable max_ptys) makes digits[5] an OOB slice-write panic (ring-0 halt). Sized to [u8; 10] (u32 worst case). devpts = real_triggerable, pty = latent twin. Sibling decimal-buffer sites (drm_kms u16->[5], ima u8->[3], fat ~N guarded, pty_master u16->[8], fat32_lfn bounded) all verified correctly-sized. Gate: clippy -p oncrix-vfs ✓ + build ✓ + fmt ✓.

devpts and pty rendered the pts index to decimal digits in a 5-byte
stack buffer via 'while n > 0 { digits[dcount] = ...; dcount += 1 }'. The
index is a u32 (max 10 digits) bounded only by a configurable max_ptys,
so an index >= 100000 makes dcount reach 5 and digits[5] panics with an
out-of-bounds slice write (ring-0 halt). Size the buffer to the u32 worst
case ([u8; 10]). devpts = real_triggerable; pty = latent twin.
@kernalix7 kernalix7 force-pushed the fix/devpts-pty-digit-buffer-oob branch from d7be407 to 2af0289 Compare June 23, 2026 02:31
@kernalix7 kernalix7 merged commit 4b07a55 into main Jun 23, 2026
2 checks passed
@kernalix7 kernalix7 deleted the fix/devpts-pty-digit-buffer-oob branch June 23, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant