Is that not a big hole that the kernel provides ?. If I have a root access, then I can spoil the whole system.
Is there any motive for the kernel to support this ?
Thanks,
Prabhu
On Wed, Oct 27, 2010 at 10:04 AM, Dave Hylands <dhylands@xxxxxxxxx> wrote:
Hi Prabhu,
Absolutely.
On Tue, Oct 26, 2010 at 9:19 PM, Prabhu nath <gprabhunath@xxxxxxxxx> wrote:
> Dear All,
>
> Can you please clarify my doubt on /dev/mem
>
> When I open /dev/mem, Is that entire physical address space is
> associated to /dev/mem or only the system memory ?
> * If I can mmap the kernel memory in read write mode, I can screw
> up the whole kernel. Is that right ?
Accessing through /dev/mem has no impact on the page allocator.
> * Suppose I map a random memory page frame (let's assume it is a
> free page) from physical address 1abde000 to 1abdf000,
> then will the page allocator not allocate this page to to any
> other task or to the kernel ?
Accessing memory through /dev/mem is the same thing as the kernel
accessing that memory from within kernel space. You can access
allocated pages, unallocated pages, device registers, pretty much
anything at all. Writing indiscriminantly through /dev/mem is the same
thing as writing indiscriminantly from within a driver.
--
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/