From owner-freebsd-arch@FreeBSD.ORG Sat Feb 28 03:06:01 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4D87616A4CE for ; Sat, 28 Feb 2004 03:06:01 -0800 (PST) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90BFE43D1F for ; Sat, 28 Feb 2004 03:05:58 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i1SB5p5O005229; Sat, 28 Feb 2004 22:05:51 +1100 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i1SB5m0I012148; Sat, 28 Feb 2004 22:05:49 +1100 Date: Sat, 28 Feb 2004 22:05:47 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Poul-Henning Kamp In-Reply-To: <11616.1077888933@critter.freebsd.dk> Message-ID: <20040228214619.S6048@gamplex.bde.org> References: <11616.1077888933@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= cc: arch@freebsd.org Subject: Re: per-device sysctls X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2004 11:06:01 -0000 On Fri, 27 Feb 2004, Poul-Henning Kamp wrote: > In message <20040227230124.D2469@gamplex.bde.org>, Bruce Evans writes: > >Only broken drivers use sysctl variables. ioctl(3) is a much better > >interface that sysctl(3) for accessing per-device info. sysctl(8) is > >a better interface than ioctl(8) for handling the few device control > >things that can be done in a generic way, but this is only because > >there are so few such things that ioctl(8) doesn't exist. > > sysctl is superior for properties that should not be vulnerable > to any user who happens to be able to open the device. Nope. Only broken drivers would provide more features than are intended to any user who happens to be able to open the device. Many drivers require write access to do write-like operations, and some bogusly require appropriate privilege. Extra device nodes (control devices) are be required to provide access to certain features (especially when opening the normal device is required to have a side effect). There is much more support for access control on device nodes than on sysctls. Bruce