Skip to content
Snippets Groups Projects
Commit df69a596 authored by Pekka Enberg's avatar Pekka Enberg
Browse files

munmap: Fail if munmap address range is not mapped


Make sure that the address range passed to munmap() is actually mapped.

Reviewed-by: default avatarRaphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 6495e14c
No related branches found
No related tags found
No related merge requests found
......@@ -161,6 +161,9 @@ int munmap_validate(void *addr, size_t length)
if (!mmu::is_page_aligned(addr) || length == 0) {
return EINVAL;
}
if (!mmu::ismapped(addr, length)) {
return EINVAL;
}
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment