raspi-kernel
raspi-kernel copied to clipboard
Possible issues with mem.c
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.