voron

experimental ARM OS
git clone git://git.2f30.org/voron
Log | Files | Refs | README | LICENSE

commit 7dbbbfdd051d82b8eeba896d7e42af5007a7d0d4
parent 6e4eddb298de842f598521c075df71f363aaff7f
Author: oblique <psyberbits@gmail.com>
Date:   Fri, 26 Apr 2013 17:25:29 +0300

mmu.c,kmmap: check if the virtual address is PAGE_SIZE aligned.

Diffstat:
Mkernel/mmu.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/mmu.c b/kernel/mmu.c @@ -203,11 +203,11 @@ kmmap(void *virt, uint_t npages, mmu_ap_t perms) uintptr_t virt_a; void *pa; - if (npages == 0) - return -EINVAL; - virt_a = (uintptr_t)virt; + if (npages == 0 || virt_a & (PAGE_SIZE - 1)) + return -EINVAL; + /* overflow */ if (virt_a + npages * PAGE_SIZE < virt_a) return -EFAULT;