From owner-freebsd-bugs Tue Dec 11 4:20: 7 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0F01137B416 for ; Tue, 11 Dec 2001 04:20:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBBCK2e97057; Tue, 11 Dec 2001 04:20:02 -0800 (PST) (envelope-from gnats) Date: Tue, 11 Dec 2001 04:20:02 -0800 (PST) Message-Id: <200112111220.fBBCK2e97057@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Seth Subject: Re: kern/32677: pciconf -l opens /dev/pci for O_RDWR Reply-To: Seth Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/32677; it has been noted by GNATS. From: Seth To: Mike Smith Cc: Brooks Davis , FreeBSD-gnats-submit@FreeBSD.ORG, msmith@mass.dis.org Subject: Re: kern/32677: pciconf -l opens /dev/pci for O_RDWR Date: Tue, 11 Dec 2001 07:13:07 -0500 Mike/Brooks, Thanks for the update & explanation. I guess this means that stock pciconf will remain unusable on systems where securelevel > 0 until the Alpha code can be tweaked? If I were to patch my own code to open O_RDONLY (I'm on Intel/AMD), do you anticipate that I would experience any problems such as you describe below? Thanks, Seth. On Mon, Dec 10, 2001 at 02:35:23PM -0800, Mike Smith wrote: > > On Mon, Dec 10, 2001 at 01:06:15PM -0500, seth@psychotic.aberrant.org wrote: > > > Check arguments to pciconf. If -l, open O_RDONLY. > > > > This doesn't actually work. The current ioctl access controls require > > that you have the device opened for write in all cases. This is a rather > > odd check, but it's the case. My recollection of the last conversation > > about this on the lists is that on some configurations the ability to > > read pci state is the ability to crash the system so it is restricted. > > It seems PCIOCGETCONF and PCIOCREAD should probalby be allowed if the > > user can read the device and the device nodes should be fixed to be > > unreadable to non-root users, but there may be some reason for the > > current configuration that I don't know about. I've CC'd Mike Smith for > > his opinion on this. > > The problem with reading is that on some Alpha systems, you can cause > a machine check with an unaligned read. The correct fix would be to > reject these reads at a suitable level in the Alpha PCI code, but a > bandaid was implemented instead. > > A correct fix for this would be to correct the Alpha PCI code to check, and > then check the open mode in a more logical fashion. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message