4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-12 20:19:14 +08:00
Ken Brown fe598b89e8 Cygwin: mmap: fix protection when unused pages are recycled
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>
(cherry picked from commit 677e3150907a83f17e50d546f79b7ca863ebd77d)
2024-12-19 10:47:56 -05:00
..
2024-09-12 10:57:24 -04:00

THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESSED OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Cygwin documentation is available on the net at https://cygwin.com
You might especially be interested in

https://cygwin.com/faq/faq.html#faq.programming.building-cygwin