[pcre-dev] [Bug 1749] PCRE-JITted code should be executed fr…

Góra strony
Delete this message
Autor: admin
Data:  
Dla: pcre-dev
Stare tematy: [pcre-dev] [Bug 1749] New: PCRE-JITted code should be executed from non-writable memory to obey execmem SELinux restriction
Temat: [pcre-dev] [Bug 1749] PCRE-JITted code should be executed from non-writable memory to obey execmem SELinux restriction
https://bugs.exim.org/show_bug.cgi?id=1749

Petr Pisar <ppisar@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #958 is|0                           |1
           obsolete|                            |


--- Comment #19 from Petr Pisar <ppisar@???> ---
Created attachment 959
--> https://bugs.exim.org/attachment.cgi?id=959&action=edit
Failed attempt for temporary file approach

I tried to change the current code to use a temporary file. Attachment is one
big hack only for x86 Linux with -DSLJIT_PROT_EXECUTABLE_ALLOCATOR=1 as quick
test.

This first patch in the attachment modifies the protected allocator to use
temporary files. It still keeps mprotect() in action.

The second patch replaces mprotect() by swapping the two mappings from one
file. But it crashes somewhere at the end of jit_machine_stack_exec().
Probably the PROT_WRITE mapping addresses gets backed into the jitted code and
simple replacement with PROT_EXEC mapping address at the end of
sljit_generate_code() is not enough.

I present the patches here only for you inspiration if you wanted to give
a try.

--
You are receiving this mail because:
You are on the CC list for the bug.