Konstantin Belousov e401a6a54e 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-04-15 20:43:12 +00:00
2008-09-23 14:25:56 +00:00
2008-08-03 21:07:19 +00:00
2009-05-12 17:05:40 +00:00
2008-11-27 04:40:37 +00:00
2008-09-22 10:37:02 +00:00
2008-05-12 06:42:06 +00:00
2008-05-23 04:06:49 +00:00
2007-12-14 21:30:51 +00:00
2009-03-30 15:01:29 +00:00
2009-04-21 19:14:13 +00:00