tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] PATCH: Suggest configuring --with-selinux if mprotect fai


From: Edmund Grimley Evans
Subject: [Tinycc-devel] PATCH: Suggest configuring --with-selinux if mprotect fails.
Date: Tue, 11 Oct 2016 18:36:38 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Any objections to this?

    Suggest configuring --with-selinux if mprotect fails.

diff --git a/tccrun.c b/tccrun.c
index 4903f90..1025500 100644
--- a/tccrun.c
+++ b/tccrun.c
@@ -230,7 +230,8 @@ static void set_pages_executable(void *ptr, unsigned long 
length)
     start = (addr_t)ptr & ~(PAGESIZE - 1);
     end = (addr_t)ptr + length;
     end = (end + PAGESIZE - 1) & ~(PAGESIZE - 1);
-    mprotect((void *)start, end - start, PROT_READ | PROT_WRITE | PROT_EXEC);
+    if (mprotect((void *)start, end - start, PROT_READ | PROT_WRITE | 
PROT_EXEC))
+        tcc_error("mprotect failed: did you mean to configure 
--with-selinux?");
   #ifndef __PCC__
     __clear_cache(ptr, (char *)ptr + length);
   #else



reply via email to

[Prev in Thread] Current Thread [Next in Thread]