Re: [PATCH] Fix mmap_kmem (was: [question] What's the differencebetween /dev/kmem and /dev/mem)
From: Alan Cox
Date: Tue Aug 16 2005 - 18:07:30 EST
On Maw, 2005-08-16 at 17:12 -0500, Greg Edwards wrote:
> mmap_mem suffers from a lack of proper checks as well. For example, on
> Altix page 0 of each node is reserved for prom and a read or write to it
> will cause an MCA. mmaping /dev/mem with offset 0 will nicely explode.
> Would adding a pfn_valid test in mmap_mem be the best bet, or could we
> consolidate the checks currently in mmap_kmem into mmap_mem?
If you use /dev/mem you should know what you are doing. Even with
"checks" dd if=/dev/zero of=/dev/mem will do bad things. Trapping
obviously bad cases is fine, but complete sanity checking may actually
be counter productive.
-
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/