Re: [RFC] prevent "dd if=/dev/mem" crash

Andrew Morton
2003-10-17T22:50:28Z

Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
>
> Old behavior:
>
> # dd if=/dev/mem of=/dev/null
> <unrecoverable machine check>

I recently fixed this for ia32 by changing copy_to_user() to not oops if
the source address generated a fault. Similarly copy_from_user() returns
an error if the destination generates a fault.

In other words: drivers/char/mem.c requires that the architecture's
copy_*_user() functions correctly handle faults on either the source or
dest of the copy.