Red Hat Bugzilla – Bug 6936
'more /proc/misc' segfaults
Last modified: 2008-05-01 11:37:52 EDT
Not much more to say:
[kmaraas@km-lt kmaraas]$ rpm -qf /bin/more
[kmaraas@km-lt kmaraas]$ more /proc/misc
Segmentation fault (core dumped)
This is not a bug in more: it's a bug in /proc/misc(!) When doing a low-level
read(2) on /proc/misc, asking for a small number of bytes (say, 2) returns
the full size of what /proc/misc has to offer even if this overflows the
caller's buffer. More allocates a two-byte buffer on the stack, and the
stack gets trashed when the read(2) call returns 26 instead of two.
Not sure if I will be able to track down the kernel problem, but at least
don't waste your time looking at more(1).