aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/mm/mmap.cc
AgeCommit message (Collapse)AuthorFilesLines
7 daysCygwin: mmap_list::try_map: fix a condition in a test of an mmap requestKen Brown1-1/+1
In testing whether the requested area is contained in an existing mapped region, an incorrect condition was used due to a misinterpretation of the u_addr and u_len variables. Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256913.html Fixes: c68de3a262fe5 ("* mmap.cc (class mmap_record): Declare new map_pages method with address parameter.") Signed-off-by: Ken Brown <kbrown@cornell.edu>
7 daysCygwin: mmap: fix protection when unused pages are recycledKen Brown1-13/+18
Previously, when unused pages from an mmap_record were recycled, they were given the protection of the mmap_record rather than the protection requested in the mmap call. Fix this by adding a "new_prot" parameter to mmap_list::try_map() and mmap_record::map_pages() to keep track of the requested protection. Then use new_prot in the calls to VirtualProtect(). Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256911.html Fixes: f90e23f2714cb ("*autoload.cc (NtCreateSection): Define.") Signed-off-by: Ken Brown <kbrown@cornell.edu>
2022-08-23Cygwin: mmap: use SRWLOCK instead of mutoCorinna Vinschen1-18/+21
To reduce thread contention, use reader/writer locks as required. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-10Cygwin: make check_invalid_virtual_addr a static inline functionCorinna Vinschen1-0/+13
move it to mm/mmap.cc which uses it exclusively. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-10Cygwin: move memory management sources into mm subdirCorinna Vinschen1-0/+1896
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>