From owner-freebsd-stable Fri Dec 1 16:44:16 2000 Delivered-To: freebsd-stable@freebsd.org Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by hub.freebsd.org (Postfix) with ESMTP id 62AA537B400; Fri, 1 Dec 2000 16:44:12 -0800 (PST) Received: (from ken@localhost) by panzer.kdm.org (8.9.3/8.9.1) id RAA17190; Fri, 1 Dec 2000 17:44:08 -0700 (MST) (envelope-from ken) Date: Fri, 1 Dec 2000 17:44:08 -0700 From: "Kenneth D. Merry" To: hackers@FreeBSD.ORG Cc: stable@FreeBSD.ORG Subject: Re: PCIOCGETCONF/PCIOCREAD requires write permission? Message-ID: <20001201174408.A17122@panzer.kdm.org> References: <200012012056.eB1KuDI32343@orthanc.ab.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200012012056.eB1KuDI32343@orthanc.ab.ca>; from lyndon@orthanc.ab.ca on Fri, Dec 01, 2000 at 01:56:13PM -0700 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Dec 01, 2000 at 13:56:13 -0700, Lyndon Nerenberg wrote: > [Observed on 4.2-STABLE, but I've redirected replies to the hackers list.] > > 'pciconf -l' is documented to work for non-priv users, however the > first thing the underlying ioctl code (pci_ioctl) does is bail with EPERM > if the caller does not have /dev/pci open for write. The documentation is wrong, unfortunately. > Is there any reason why the FWRITE test cannot/should not be moved down > into the 'case PCIOCWRITE' part of the switch? This would make both > PCIOCGETCONF and PCIOCREAD work for readonly access to /dev/pci (which > seems to me to be saner behaviour). At least with the PCIOCGETCONF, you need write permission, because it copies in patterns to match against. As for PCIOCREAD, it only allows reading of PCI registers, so the question there is whether there are any potential security implications to allowing non-root users to read PCI registers. If reading configuration registers caused performance degredation, for instance. Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message