mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-22 04:52:56 +01:00
When using an ELF image as returned from the iso9660 server, such an image is represented as a managed dataspace composed of various portions of one RAM dataspace, each portion attached with a different offset. Now, when mapping the text segment of the ELF image (usually starting at 0x1000 within the image), the code mapped at 0x1000 may correspond to any offset within the RAM dataspace used by the iso9660 server. In particular, the src-fault address (the one within the RAM dataspace) may be higher than dst-fault address (somewhere just above 0x1000 where a page-fault occurred). Thereby, 'curr_rm_base' may become negative during the reverse lookup of 'Rm_client::pager'. This corner case used to let the 'Fault_area::constrain' function return an invalid fault area, and thereby let the reverse lookup fail. The improved version explicitly checks for the address overflow condition and tries to constrain the dst fault address to the largest possible log2 page within the positive address range.