kern/70236: uninitialised parameters passed to kernel_sysctl

Matthew Luckie mjl at luckie.org.nz
Mon Aug 9 19:00:40 PDT 2004


>Number:         70236
>Category:       kern
>Synopsis:       uninitialised parameters passed to kernel_sysctl
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 10 02:00:38 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Matthew Luckie
>Release:        FreeBSD 4.10
>Organization:
University of Waikato
>Environment:
FreeBSD lycra.luckie.org.nz 4.10-RELEASE-p2 FreeBSD 4.10-RELEASE-p2 #7: Wed Jul 28 08:39:51 NZST 2004     root at lycra.luckie.org.nz:/files/freebsd_src/sys/compile/lycra  i386
>Description:
      I found two instances of kernel_sysctl being called without olen being set.
>How-To-Repeat:
      N/A
>Fix:
--- sys/nwfs/nwfs_vfsops.c.orig	Tue Aug 10 13:51:32 2004
+++ sys/nwfs/nwfs_vfsops.c	Tue Aug 10 13:51:52 2004
@@ -394,6 +394,7 @@
 
 	name[0] = CTL_HW;
 	name[1] = HW_NCPU;
+	olen = sizeof(ncpu);
 	error = kernel_sysctl(curproc, name, 2, &ncpu, &olen, NULL, 0, &plen);
 	if (error == 0 && ncpu > 1)
 		printf("warning: nwfs module compiled without SMP support.");


--- sys/netsmb/smb_subr.c.orig	Tue Aug 10 13:49:14 2004
+++ sys/netsmb/smb_subr.c	Tue Aug 10 13:50:14 2004
@@ -375,6 +375,7 @@
 
 	name[0] = CTL_HW;
 	name[1] = HW_NCPU;
+	olen = sizeof(ncpu);
 	error = kernel_sysctl(curproc, name, 2, &ncpu, &olen, NULL, 0, &plen);
 	if (error)
 		return error;

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list