From: Matthias Kruk Date: Wed, 25 Sep 2019 10:03:51 +0000 (+0900) Subject: Make sure PAGE_ATTR_USER is set on page tables when we're mapping something with... X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=fd98c9a86eb8100b19cb81dc9d84df6067d093c9;p=corax Make sure PAGE_ATTR_USER is set on page tables when we're mapping something with PAGE_ATTR_USER within them (IA-32 legacy paging) --- diff --git a/kernel/arch/paging.c b/kernel/arch/paging.c index 7f5a624..222df81 100644 --- a/kernel/arch/paging.c +++ b/kernel/arch/paging.c @@ -723,6 +723,11 @@ static int _pg_dir_map_legacy(page_table_t *pd, u32_t paddr, u32_t vaddr, pt = (page_table_t*)(pd->pt_entries[pde] & 0xfffff000); + /* make sure PAGE_ATTR_USER is set on the page table, if necessary */ + if(flags & PAGE_ATTR_USER) { + pd->pt_entries[pde] |= PAGE_ATTR_USER; + } + if(pt->pt_entries[pte] & PAGE_ATTR_PRESENT) { ret_val = -EALREADY; break;