Alexandre Julliard : preloader: Workaround for broken no-exec protections.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 12 14:02:28 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 0216c404dcf9cf610faf66b7bb0e1c07d626261b
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=0216c404dcf9cf610faf66b7bb0e1c07d626261b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Apr 12 19:53:16 2006 +0200

preloader: Workaround for broken no-exec protections.

Add an executable page at the top of the address space to defeat
broken no-exec protections that play with the code selector limit.

---

 loader/preloader.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/loader/preloader.c b/loader/preloader.c
index 9480ca9..3439517 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -949,6 +949,10 @@ void* wld_start( void **stack )
         wld_mmap( preload_info[i].addr, preload_info[i].size,
                   PROT_NONE, MAP_FIXED | MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, -1, 0 );
 
+    /* add an executable page at the top of the address space to defeat
+     * broken no-exec protections that play with the code selector limit */
+    wld_mprotect( (char *)0x80000000 - page_size, page_size, PROT_EXEC | PROT_READ );
+
     /* load the main binary */
     map_so_lib( argv[1], &main_binary_map );
 




More information about the wine-cvs mailing list