kib 7361db2279 Do not advance req->oldidx when sysctl_old_user returning an
error due to copyout failure or short buffer.

The later breaks the usermode iterators of the sysctl results that pack
arbitrary number of variable-sized structures. Iterator expects that
kernel filled exactly oldlen bytes, and tries to interpret half-filled
or garbage structure at the end of the buffer. In particular,
kinfo_getfile(3) segfaulted.

Reported and tested by:	pho
MFC after:	3 weeks
2009-05-14 10:54:57 +00:00
..
2009-05-12 16:38:32 +00:00
2009-05-14 09:28:02 +00:00
2009-03-09 13:32:19 +00:00
2009-04-01 17:06:28 +00:00