Skip to content

Possible issues with mem.c #32

@Paletech35

Description

@Paletech35

A couple possible issues with mem.c, in alloc_page:
-The address of the start of the page is calculated by page_mem = (void *)((page - all_pages_array) * PAGE_SIZE);, however page_t has size 4 bytes, so page_mem is 4x too big as each entry in all_pages_array is 4 bytes.
-In allocating a page, you do not check if the page is part of the MMIO region, so a program could start writing data here erroneously.
Sorry if these aren't issues or I'm wrong about indexing into all_pages_array, I'm fairly new to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions