raspi-kernel icon indicating copy to clipboard operation
raspi-kernel copied to clipboard

Possible issues with mem.c

Open Paletech35 opened this issue 3 years ago • 0 comments

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.

Paletech35 avatar Feb 03 '22 21:02 Paletech35