lkml.org 
[lkml]   [1999]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Process VM Addr to Kernel VM Addr at Interrupt Time.
On Thu, 29 Apr 1999, Ramakrishna K wrote:

>
>
> Eric,
> I have some question's. Excuse me for my ignorance.
>
> > I have written some code that does this properly. It properly locks pages,
> > handles copy-on-write pages, and detects (and throws out, as it should)
> > attempts to lock mmap'd or page cache memory. However, there is still a
> > FATAL flaw in the code-- since the driver thread that locked the buffers
> > runs in process context, if the process is killed while the driver is
> > blocked awaiting DMA completion -- and the device is writing into user space
> > -- the device can potentially be STILL DMA'ing into that memory after it has
> > been free'd by the kernel, put into the page cache, allocated to a new
> ^^^^^^^^^^^^^^^^^^^^
> > process, etc.
> > Without a mechanism to allow the driver to be notified the process has died
> > to stop the DMA disk buffers could be destroyed, processes overwritten, etc.
> > This is a BAD THING.

Your device close function should handle this. When processes are killed,
the kernel closes all file descriptors.


Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.2.6 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.


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

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.028 / U:3.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site