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

From: Andrew Morton
Date: Fri Oct 17 2003 - 17:51:19 EST


Bjorn Helgaas <bjorn.helgaas@xxxxxx> 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.

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