Bug 32019

Summary: open() bpf crashes system
Product: Base System Reporter: david <david>
Component: kernAssignee: Poul-Henning Kamp <phk>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   

Description david 2001-11-15 21:40:01 UTC
The following code crashes the system.

/* code */
#include <err.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>

int main(void)
{
	int fd;
	char device[] = "/dev/bpf000000";
	
	if ((fd = open(device, O_RDONLY)) < 0)
		err(1, "open");

	close(fd);
	return 0;
}

Fix: 

unknown
How-To-Repeat: As root, compile the code and execute it.
Comment 1 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-11-15 21:56:20 UTC
Responsible Changed
From-To: freebsd-bugs->phk

Looks like a DEVFS / cloning problem, which makes it phk's baby.
Comment 2 Bill Fenner freebsd_committer freebsd_triage 2001-11-15 23:28:02 UTC
State Changed
From-To: open->closed

Fixed in rev 1.101 of sys/kern/kern_conf.c