From owner-freebsd-arch@FreeBSD.ORG Mon Jun 16 11:40:18 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 863CB37B401 for ; Mon, 16 Jun 2003 11:40:18 -0700 (PDT) Received: from magic.adaptec.com (magic-mail.adaptec.com [208.236.45.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id F190943F75 for ; Mon, 16 Jun 2003 11:40:17 -0700 (PDT) (envelope-from scottl@freebsd.org) Received: from redfish.adaptec.com (redfish.adaptec.com [162.62.50.11]) by magic.adaptec.com (8.11.6/8.11.6) with ESMTP id h5GIe7815887; Mon, 16 Jun 2003 11:40:07 -0700 Received: from freebsd.org (hollin.btc.adaptec.com [10.100.253.56]) by redfish.adaptec.com (8.8.8p2+Sun/8.8.8) with ESMTP id LAA15915; Mon, 16 Jun 2003 11:40:16 -0700 (PDT) Message-ID: <3EEE0E65.1000304@freebsd.org> Date: Mon, 16 Jun 2003 12:37:25 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John-Mark Gurney References: <20030616074122.GF73854@funkthat.com> <20030616193932.X27844@gamplex.bde.org> <20030616170645.GI73854@funkthat.com> In-Reply-To: <20030616170645.GI73854@funkthat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 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:40:18 -0000 John-Mark Gurney wrote: > Bruce Evans wrote this message on Mon, Jun 16, 2003 at 19:42 +1000: > >>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. >> >>IIRC, it is like it is because reading it may have side effects (and >>thus isn't really just reading). If it honored the permissions then >>it should have mode 600 so that normal users can't run pciconf -l :-]. > > > Now if we were reading the pci registers with -r, then yes, but -l just > copys the data from pci_devinfo. If we wanted to make -r readable, we'd > have to clamp the registers passed in, and make sure that all platforms > didn't trap on PCI register reads (a patch for sparc should be going in > soon). > It sounds like a reasonable idea to me. Yes, actually reading the PCI config register space from userland is generally not something that an unpriviledged user should be allowed to do because of the side effects that others have mentioned. As long as 'pciconf -l' doesn't present an information security hole or DOS opportunity, it sounds like a good idea. Scott