lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 23 Nov 2011 10:20:21 +0200
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	"Hans J. Koch" <hjk@...sjkoch.de>
Cc:	Jean-Francois Dagenais <jeff.dagenais@...il.com>,
	Greg KH <gregkh@...e.de>, tglx@...utronix.de,
	linux-pci@...r.kernel.org, open list <linux-kernel@...r.kernel.org>
Subject: Re: extra large DMA buffer for PCI-E device under UIO

On Tue, Nov 22, 2011 at 07:52:45PM +0100, Hans J. Koch wrote:
> On Tue, Nov 22, 2011 at 08:40:40PM +0200, Michael S. Tsirkin wrote:
> > On Tue, Nov 22, 2011 at 06:54:02PM +0100, Hans J. Koch wrote:
> > > On Tue, Nov 22, 2011 at 07:37:23PM +0200, Michael S. Tsirkin wrote:
> > > [...]
> > > > > Or am I better off with a UIO solution?
> > > > 
> > > > You should probably write a proper kernel driver, not a UIO one.
> > > > your kernel driver would have to prevent the device fom DMA into memory
> > > > outside the allocated range, even if userspace is malicious.
> > > > That's why UIO is generally not recommended for PCI devices that do DMA.
> > > 
> > > When UIO was designed, the main goal was the ability to handle interrupts
> > > from userspace. There was no requirement for DMA. In fact, in five years I
> > > didn't get one real world device on my desk that needed it. That doesn't
> > > mean there are no such devices. Adding DMA support to the UIO core was
> > > discussed several times but noone ever did it. Ideas are still welcome...
> > > 
> > > If parts of the driver should be in userspace, you should really try
> > > to extend the UIO core instead of re-implementing UIO functionality in
> > > a "proper kernel driver".
> > > 
> > > Thanks,
> > > Hans
> > 
> > Right, I really meant put all of the driver in the kernel.
> > If parts are in userspace, and device can do DMA,
> > you are faced with the problem as userspace suddenly
> > can access arbitrary memory through the device.
> 
> That's nothing UIO specific. You have the same problem with /dev/mem
> or graphic cards. If you're root, you can do lots of things that can
> compromise security or crash your system.
> 
> Thanks,
> Hans

With an appropriate security policy, you might not be able to,
or your attempt to do so might be logged. Even without, people
can use permissions to give non-root access to devices.
One doesn't normally expect chown mst /dev/foobar
to give mst full root on a box.

-- 
MST
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ