Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Feb 1997 06:10:03 -0800 (PST)
From:      Mike Pritchard <mpp>
To:        freebsd-bugs
Subject:   Re: bin/2676: modstat passes garbage name to kernel if name is not specified
Message-ID:  <199702061410.GAA08073@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/2676; it has been noted by GNATS.

From: Mike Pritchard <mpp>
To: gdonl@tsc.tdk.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/2676: modstat passes garbage name to kernel if name is not specified
Date: Thu, 6 Feb 1997 06:00:17 -0800 (PST)

 Does this cause modstat to not work?  From examining the
 sources (3.0 and 2.2) to modstat, and the kernel, there should
 not be a need to ensure that lmc_stat.name is zeroed out.
 The ioctl should either be called with lmc_stat.id == -1
 and a module name properly set in lmc_stat.name, or it
 will be called with a lmc_stat.id >= 0 and lmc_stat.name
 will be ignored by the ioctl.
 
 Don Lewis wrote:
 > 
 > 
 > >Number:         2676
 > >Category:       bin
 > >Synopsis:       modstat passes garbage name to kernel if name is not specified
 > >Description:
 > 
 > 	If a module name is not specified on the command line for modstat,
 > 	it fails to initialize the name field of the lmc_stat structure
 > 	before passing this to the ioctl() call.  This results in whatever
 > 	random garbage is contained on the stack being used as the module
 > 	name.
 > 
 > 	This bug is present in all releases through -current.
 > 
 > >How-To-Repeat:
 > 
 > 	Run modstat without specifying a module name.
 > >Fix:
 > 	
 > 	Clear the sbuf.name[] array in dostat() with bzero() or equivalent
 > 	instead of just NUL terminating it.
 -- 
 Mike Pritchard
 mpp@FreeBSD.org
 "Go that way.  Really fast.  If something gets in your way, turn"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702061410.GAA08073>