Ticket #87 (new defect)

Opened 21 months ago

Last modified 20 months ago

readmema and writemem handlers should check input address mapping

Reported by: may Owned by: may
Priority: major Milestone: v0.81
Component: ERESI Version:
Severity: Medium Keywords: readmema writemem mapped check
Cc:

Description (last modified by may) (diff)

The vectors "readmema" and "writemem" will in certain conditions read or write to an invalid address, leading to a segmentation fault when in e2dbg. Other programs seems immune against this error, so only elfsh_get_raw_by_addr() seem to be affected.

Many commands seems to be affected by that bug, D, X, write in particular.

In practice, for example:

The "write" command, when in debug mode, will not check if the address provided is really mapped. It will directly write to it. Its not straightforward to do that test, but I can think of 2 solutions:

- look in the linkmap if the addr is part of a mapped object (but the stack and the heap are maybe not part of the linkmap ? to verify...)

- handle the SIGSEGV and print "address not mapped" in the handler, so we could report the problem and continue the execution as if nothing had happened, obviously without doing the write.

Change History

Changed 20 months ago by may

  • keywords readmema writemem mapped check added
  • owner set to may
  • description modified (diff)
  • summary changed from write command should do a mapped check to readmema and writemem handlers should check input address mapping
Note: See TracTickets for help on using tickets.