Re: V4L2 - RFC: DMA to userspace API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> I have a couple questions.
> Is there some friendly documentation on memory locking and DMA to
> userspace in 2.4 somewhere (besides the source code)?

No (I don't know any).

> What if a malicious or buggy program free()s the buffers while the
> driver still has them? Can it crash the system?

If the driver takes care (i.e. check return values etc) it will
not crash.  If you try to create/lock kiobuf's for a invalid
userspace pointer you should get back -EINVAL, -EFAULT or something
like that.  Catch that, and you are fine.

The lock will pin down the physical pages in memory.  They will
stay even if the application free's them while they are locked.
So the DMA transfer can complete, the driver will unlock them,
then they will be freed.

  Gerd

-- 
Get back there in front of the computer NOW. Christmas can wait.
	-- Linus "the Grinch" Torvalds,  24 Dec 2000 on linux-kernel





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux