lkml.org 
[lkml]   [2010]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3] drivers/uio/uio_pci_generic.c: allow access for non-privileged processes
On Wed, Apr 21, 2010 at 12:31:50PM +0200, Hans J. Koch wrote:
> On Wed, Apr 21, 2010 at 12:38:49PM +0300, Michael S. Tsirkin wrote:
> >
> > > + j++;
> > > + }
> > > + }
> > > + for (i = 0, j = 0; i < PCI_STD_RESOURCE_END &&
> > > + j < MAX_UIO_PORT_REGIONS; i++) {
> > > + if (pci_resource_flags(pdev, i) & IORESOURCE_IO) {
> > > + name = kmalloc(8, GFP_KERNEL);
> > > + if (name == NULL)
> > > + break;
> > > + sprintf(name, "iobar%d", i);
> > > + info->port[j].name = name;
> > > + info->port[j].start = pci_resource_start(pdev, i);
> > > + info->port[j].size = pci_resource_len(pdev, i);
> > > + info->port[j].porttype = UIO_PORT_X86;
> > > + j++;
> >
> > At least on x86, I think io bar can not be mmapped.
>
> That's right. porttype == UIO_PORT_X86 is only there for information
> purposes. Userspace then knows that it cannot map this but has to use
> things like inb(), outb() and friends after getting access rights with
> ioperm()/iopl(). "start" and "size" gives userspace the information
> needed to do this.
>
> Thanks,
> Hans

So that fails in the declared purpose of allowing an unpriveledged
userspace driver, as inb/outb are priveledged operations.

--
MST


\
 
 \ /
  Last update: 2010-04-21 12:37    [W:0.053 / U:1.520 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site