Fix write rights on pageflt
This commit is contained in:
parent
91b8d48f52
commit
07a3a33719
@ -388,7 +388,7 @@ free_reg:
|
|||||||
int uAddrSpaceSolvePageFault(struct uAddrSpace *as, vaddr_t faultAddr, int isWriteAccess)
|
int uAddrSpaceSolvePageFault(struct uAddrSpace *as, vaddr_t faultAddr, int isWriteAccess)
|
||||||
{
|
{
|
||||||
struct uAddrVirtualReg *reg;
|
struct uAddrVirtualReg *reg;
|
||||||
int rights = PAGING_MEM_READ;
|
int rights = PAGING_MEM_READ | PAGING_MEM_USER;
|
||||||
|
|
||||||
reg = findVirtualRegionFromAddr(as, faultAddr, 1);
|
reg = findVirtualRegionFromAddr(as, faultAddr, 1);
|
||||||
|
|
||||||
@ -400,7 +400,7 @@ int uAddrSpaceSolvePageFault(struct uAddrSpace *as, vaddr_t faultAddr, int isWri
|
|||||||
if (isWriteAccess && !(reg->right & PAGING_MEM_WRITE))
|
if (isWriteAccess && !(reg->right & PAGING_MEM_WRITE))
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
|
||||||
if (isWriteAccess)
|
if (isWriteAccess || (reg->right & PAGING_MEM_WRITE))
|
||||||
rights |= PAGING_MEM_WRITE;
|
rights |= PAGING_MEM_WRITE;
|
||||||
|
|
||||||
if (reg->res->ops->nopage(reg, faultAddr, rights))
|
if (reg->res->ops->nopage(reg, faultAddr, rights))
|
||||||
|
Loading…
Reference in New Issue
Block a user