Bug 19605

Summary: FreeBSD 4.0-RELEASE panics on incorrect use of ioctl()
Product: Base System Reporter: demond <demond>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-RELEASE   
Hardware: Any   
OS: Any   

Description demond 2000-06-30 16:40:01 UTC
	I tested this on several 4.0-RELEASE boxes (as unprivileged user):

	#include <sys/types.h>
        #include <sys/ioctl.h>
        #include <sys/socket.h>
        #include <net/if.h>
        main() {
          struct ifconf ifc;
          int sd = socket(PF_INET, SOCK_DGRAM, 0);
          ioctl(sd, SIOCGIFCONF, (char *)&ifc);
        }

	The result: kernel panic & reboot.
	
	Other FreeBSD versions don't seem to be affected.

Fix: 

Wish I had time to investigate... The problem is obviously 
	caused by incorrect ioctl() use (not supplying proper buffer
	in ifconf struct).
How-To-Repeat: 
	See above.
Comment 1 Jacques Vidrine freebsd_committer freebsd_triage 2000-07-03 00:46:08 UTC
State Changed
From-To: open->closed

This was fixed in rev 1.86 and rev 1.85.2.1 of sys/net/if.c. 
See also PR kern/17311.