Re: Process VM Addr to Kernel VM Addr at Interrupt Time.

Richard B. Johnson (
Thu, 29 Apr 1999 11:49:55 -0400 (EDT)

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.

Dick Johnson
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
Please read the FAQ at