Skip to content
Discussion options

You must be logged in to vote

In a main program that is compressed by UPX, then the run-time execution stub (the de-compressor) could be changed to use {memfd_create + ftruncate + mmap(,, |PROT_WRITE,|MAP_SHARED,,) + store + munmap() + mmap(,, PROT_EXEC,,,)} instead of mprotect(,,|PROT_EXEC). This has already been done for shared libraries in the current release upx-4.1.0. (See the code in upx/src/stub/src/amd64-linux.elf-so_main.c). So please try such a shared library with a non-compressed main program.

I have no sympathy for an outright ban on JIT (Just In Time) code. Such a ban imposes exorbitant costs in complexity, size, and speed. If memfd_create is banned (and the equivalent using /dev/shm with an explicit file…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@239
Comment options

@jreiser
Comment options

jreiser Mar 26, 2025
Collaborator

Answer selected by 239
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #702 on August 29, 2023 13:32.