Skip to content

fix(vfs): bound procfs maps VMA loop and seq_file iteration#133

Merged
kernalix7 merged 1 commit into
mainfrom
fix/procfs-vma-seq-loop-bounds
Jun 23, 2026
Merged

fix(vfs): bound procfs maps VMA loop and seq_file iteration#133
kernalix7 merged 1 commit into
mainfrom
fix/procfs-vma-seq-loop-bounds

Conversation

@kernalix7

Copy link
Copy Markdown
Owner

Two panic/hang fixes on /proc read paths:

  • procfs_pid::generate_maps iterated 0..desc.vma_count indexing a fixed [VmaEntry; MAX_VMA]; a descriptor with more VMAs than MAX_VMA indexes OOB. Siblings fd_count/cmdline_len/environ_len already clamp with .min(); clamp the loop to MAX_VMA.
  • seq_file::fill looped while ops.next() yielded Some; a SeqOps whose next() never returns None while show() makes no progress spins forever (the overflow break never fires). Add a hard 1<<20 iteration cap.

procfs_pid::generate_maps iterated 0..desc.vma_count while indexing a
fixed [VmaEntry; MAX_VMA] array; a descriptor reporting more VMAs than
MAX_VMA would index out of bounds (siblings fd_count/cmdline_len/
environ_len already clamp with .min()). Clamp the loop to MAX_VMA.

seq_file::fill looped while ops.next() yielded Some; a SeqOps whose
next() never returns None while show() makes no progress (so the
overflow break never fires) would spin forever on a /proc read. Add a
hard 1<<20 iteration cap.
@kernalix7 kernalix7 merged commit dce384c into main Jun 23, 2026
2 checks passed
@kernalix7 kernalix7 deleted the fix/procfs-vma-seq-loop-bounds branch June 23, 2026 02:35
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