Thanks a lot for the clarification.
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 <[email protected]> wrote:

> Hi Prabhu,
>
> On Tue, Oct 26, 2010 at 9:19 PM, Prabhu nath <[email protected]>
> 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 ?
>
> Absolutely.
>
> >          * 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 through /dev/mem has no impact on the page allocator.
>
> 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/
>

Reply via email to