mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 12:56:06 +00:00
cleanup (#764)
This commit is contained in:
1 parent
4163b31b02
commit
83ec5708ed
852 files changed
+4844
-46144
No files matched your search
@@ -1,9 +1,3 @@
|
||||
/*
|
||||
* noexec.c: FEX runs an x86 program and its libraries where they lie, on noexec shared storage too.
|
||||
* FEX maps them with the guest's PROT_EXEC, which the kernel refuses for a file on a noexec mount,
|
||||
* but it never runs those pages itself - it runs its own translation of them - so a mapping or an
|
||||
* mprotect refused for that alone is made without PROT_EXEC. Only in FEX's own processes.
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
@@ -12,7 +6,6 @@
|
||||
#include <sys/statvfs.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* NOEXEC_TEST: tools/tests builds it for the host. */
|
||||
#if defined(__aarch64__) || defined(NOEXEC_TEST)
|
||||
|
||||
static int in_fex(void) {
|
||||
@@ -28,7 +21,6 @@ static int in_fex(void) {
|
||||
return known;
|
||||
}
|
||||
|
||||
/* After an mmap failed (fsync.c's mmap asks): whether to map it again without PROT_EXEC. */
|
||||
__attribute__((visibility("hidden"))) int bl_noexec_retry(int prot, int flags, int fd) {
|
||||
int error = errno;
|
||||
struct statvfs vfs;
|
||||
@@ -40,7 +32,6 @@ __attribute__((visibility("hidden"))) int bl_noexec_retry(int prot, int flags, i
|
||||
|
||||
static int (*real_mprotect)(void *, size_t, int);
|
||||
|
||||
/* Looked up before anything runs: Wine calls mprotect from its signal handlers, where dlsym is unsafe. */
|
||||
__attribute__((constructor)) static void noexec_init(void) {
|
||||
real_mprotect = (int (*)(void *, size_t, int))dlsym(RTLD_NEXT, "mprotect");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user