*BSD News Article 85953


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.mel.connect.com.au!news.mel.aone.net.au!grumpy.fl.net.au!news.webspan.net!ix.netcom.com!netcom.net.uk!dispatch.news.demon.net!demon!arg1.demon.co.uk!not-for-mail
From: Andrew Gordon <andrew.gordon@net-tel.co.uk>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Accessing i/o-ports from user-code ?
Date: Tue, 31 Dec 1996 11:42:19 +0000
Lines: 16
Message-ID: <32C8FC1B.41C67EA6@net-tel.co.uk>
References: <87g20rbmk6.fsf@acme1.ruhr.de> <5a9eom$huj@uriah.heep.sax.de>
NNTP-Posting-Host: arg1.demon.co.uk
X-NNTP-Posting-Host: arg1.demon.co.uk
X-Mailer: Mozilla 3.01Gold (X11; I; FreeBSD 2.1.5-RELEASE i386)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:33405

J Wunsch wrote:
> 
> Christoph Haas <chris@acme1.ruhr.de> wrote:
> 
> > I need to access i/o-ports from within my application. I wanted to use
> > inb() and outb() to send  bytes to a certain  port that is used by  an
> > isa  card, but I got  a bus error.  Do I  need  special permissions to
> > access the ports...
> 
> Yes.  You need to keep a filedescriptor open on /dev/io for this.  If
> you're going to make your binary setuid root for this purpose, be
> careful to drop permissions as soon as possible.

Note that you still need to be very careful even having reverted to
some other uid - the I/O access permissions are inherited by child
processes.