Bug 25476

Summary: [PATCH] The syscall oldgetkerninfo can return bogus values.
Product: Base System Reporter: un1i <un1i>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description un1i 2001-03-01 15:20:01 UTC
In src/sys/kern/kern_sysctl: ogetkerninfo(), in "case KINFO_BSDI_SYSINFO:",
the variable size is used without being initialized.  Depending on what
value it happens to have, the parameter *size may be set to a bogus value.
On my system, this causes Netscape-3.04 to crash.

Second, the return value shouldn't be the amount of information copied,
but the amount available (which canbe larger).  See the BSDI man page, e.g.:
http://www.neosoft.com/neosoft/man/getkerninfo.2.html

Fix: -Initialize size.
-Fix the return value for this case and adjust the comment.

How-To-Repeat: 
(I can give my kernel configuration file, if wanted.  But whether this
variable happens to have a value that causes Netscape to crash, or not,
is apparently somewhat random.  Considering that this bug hasn't been
fixed for so long, it is probably quite seldom :-) )
Comment 1 iedowse freebsd_committer freebsd_triage 2001-11-21 18:45:32 UTC
State Changed
From-To: open->feedback


Does this problem still exist?
Comment 2 iedowse freebsd_committer freebsd_triage 2002-06-02 11:59:37 UTC
State Changed
From-To: feedback->closed


Feedback timeout (but the patch in the PR was applied).