-
What's the problem (or question)?Running compressed binaries by a systemd service using What should have happened?Same execution as without Do you have an idea for a solution?I guess this can't be fixed if I am not mistaken:
How can we reproduce the issue?
Please tell us details about your environment.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
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 filename that is immediately unlink()ed) then UPX cannot work at all. |
Beta Was this translation helpful? Give feedback.
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…