Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

0.6.6: handle_page_fault() behavour

 
Post new topic   Reply to topic    Syllable Forum Index -> Bugs - Fixed
View previous topic :: View next topic  
Author Message
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Tue May 19, 2009 2:52 pm    Post subject: 0.6.6: handle_page_fault() behavour Reply with quote

If a page fault happens and it's a valid page (I.e. an area exists) handle_page_fault() ends up calling load_area_page(), which will in turn call either handle_write_prot() (If the page is PTE_PRESENT but not PTE_WRITE) or handle_not_present() (If the page is not PTE_PRESENT). Either it a) Create a new COW page b) Create a new empty page and c) if its mapped to a file, loads the data from the file into the new area.

At no point does it check the READ/WRITE flags on the area it's mapping for.

This effectively means the flags AREA_READ & AREA_WRITE have little effect: if you create a read-only area and attempt to write to it, handle_page_fault() will generate a COW page and mark the new page PTE_WRITE.
Back to top
View user's profile Send private message Send e-mail
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Wed May 20, 2009 4:08 am    Post subject: Reply with quote

Fixed in CVS. load_area_page() now checks the permissions (AREA_READ/AREA_WRITE) of the area that the fault is for before it does the COW or loads a new physical page. If the protection for the area does not match the PGE type it becomes a SEGV.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Bugs - Fixed All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group