[Crash-utility] Unable to change the content of memory usingcrash on a live system

Dave Anderson anderson at redhat.com
Thu Mar 6 15:12:11 UTC 2008


Wright, David wrote:
> On the other hand, there's nothing to prevent the
> ambitious developer from writing their own 
> /dev/crash driver that *does* have a write operation
> in it, is there?
> 
>   -- David Wright, Egenera, Inc. 
> 

Nope.  Or removing the restriction from the /dev/mem driver,
which runs into the per-arch devmem_is_allowed() function.

Here's the "arch/i386/mm/init.c" version:

/*
  * devmem_is_allowed() checks to see if /dev/mem access to a certain address is
  * valid. The argument is a physical page number.
  *
  * On x86, access has to be given to the first megabyte of ram because that area
  * contains bios code and data regions used by X and dosemu and similar apps.
  * Access has to be given to non-kernel-ram areas as well, these contain the PCI
  * mmio resources as well as potential bios/acpi data regions.
  */
int devmem_is_allowed(unsigned long pagenr)
{
         if (pagenr <= 256)
                 return 1;
         if (!page_is_ram(pagenr))
                 return 1;
         return 0;
}

Dave




More information about the Crash-utility mailing list