From owner-freebsd-arch@FreeBSD.ORG Mon Jun 16 11:41:33 2003 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 A366737B401; Mon, 16 Jun 2003 11:41:33 -0700 (PDT) Received: from mail.cyberonic.com (mail.cyberonic.com [4.17.179.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 842DF43F75; Mon, 16 Jun 2003 11:41:32 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (node-40244c0a.sfo.onnet.us.uu.net [64.36.76.10]) by mail.cyberonic.com (8.12.8/8.12.5) with ESMTP id h5GJ77Mo015419; Mon, 16 Jun 2003 15:07:07 -0400 Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.9/8.11.6) id h5GIg4gI011116; Mon, 16 Jun 2003 11:42:04 -0700 (PDT) (envelope-from jmg) Date: Mon, 16 Jun 2003 11:42:04 -0700 From: John-Mark Gurney To: Robert Watson Message-ID: <20030616184204.GL73854@funkthat.com> Mail-Followup-To: Robert Watson , arch@freebsd.org References: <20030616074122.GF73854@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: arch@freebsd.org Subject: Re: make /dev/pci really readable X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 18:41:33 -0000 Robert Watson wrote this message on Mon, Jun 16, 2003 at 13:54 -0400: > > On Mon, 16 Jun 2003, John-Mark Gurney wrote: > > > Does anyone have an objection to making /dev/pci really honor the > > permissions, and giving normal users (or just group wheel) premission to > > run pciconf -l. Right now the code requires the write bit set for any > > operation. > > I seem to recall that there was a problem wherein user processes could > cause cause unaligned accesses using /dev/pci. There's also some rather again, I just proposed -l, not -r to become user readable. I know that -r has problems. I've crashed the sparc box a number of times by specifing pciconf -r pci1:5:0 0x0:0xf. > odd use of useracc(), printf(), etc, in the ioctl code. I suspect this well, do you mean odd use of printf as in providing diagnostics to catch mismatched userland/kernel? for useracc, it checks to make sure that various pointers passed to it are either readable or writable. I don't see this as odd. Or is there another better method of checking user data when accessing user space buffers? other than a minor bug that could hit if there was more pci_devinfo's in the list than pci_numdevs (which should never happen, but will prevent a NULL deref), I didn't see anything wrong with -l. > code needs some fairly thorough review and cleanup before we should reduce > the level of privilege required to use the device (note that we make it > world readable by default, so changes in the semantics of read permissions > will affect all users in the system). Could you do that cleanup in the > first pass, then revisit the permissions change? sure, no problem. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."