Don't take this patch in. Please email back [email protected] if email
headers look ok.


Signed-off-by: Kanoj Sarcar <[email protected]>
---
 kern/drivers/net/udrvr/compat.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/kern/drivers/net/udrvr/compat.c b/kern/drivers/net/udrvr/compat.c
index 93890d6..7834c28 100644
--- a/kern/drivers/net/udrvr/compat.c
+++ b/kern/drivers/net/udrvr/compat.c
@@ -26,6 +26,16 @@ int map_upage_at_addr(struct proc *p, physaddr_t paddr, 
uintptr_t addr, int ptep
        pte_t   pte;
        int     rv = -1;
 
+       if (paddr > max_paddr) {
+               /*
+                * Need to add logic to __vmr_free_pgs() not to access
+                * "struct page" for PA's mapped into user space.
+                */
+               printk("[akaros]: map_upage_at_addr(): paddr=0x%llx "
+                   "max_paddr=0x%llx\n", paddr, max_paddr);
+               return -1;
+       }
+
        spin_lock(&p->pte_lock);
 
        pte = pgdir_walk(p->env_pgdir, (void*)addr, TRUE);

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to