Fixed breakage of binary compatibility of the kern.clockrate sysctl in

sys/time.h rev.1.53, etc.  Zero out the entire struct clkinfo and not
just the new spare part of it so that there is no possibility of leaking
kernel stack context to userland.
This commit is contained in:
Bruce Evans 2002-05-05 04:33:09 +00:00
parent f318190a01
commit a9a0f15a69
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96052
2 changed files with 2 additions and 0 deletions

View File

@ -479,6 +479,7 @@ sysctl_kern_clockrate(SYSCTL_HANDLER_ARGS)
/*
* Construct clockinfo structure.
*/
bzero(&clkinfo, sizeof(clkinfo));
clkinfo.hz = hz;
clkinfo.tick = tick;
clkinfo.profhz = profhz;

View File

@ -255,6 +255,7 @@ struct itimerval {
struct clockinfo {
int hz; /* clock frequency */
int tick; /* micro-seconds per hz tick */
int spare;
int stathz; /* statistics clock frequency */
int profhz; /* profiling clock frequency */
};