summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--preload.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/preload.c b/preload.c
index f5445ed..67fc793 100644
--- a/preload.c
+++ b/preload.c
@@ -181,6 +181,7 @@ static void show_segment(void)
}
static int use_secret = 1;
+static int secret_option = MFD_SECRET_EXCLUSIVE;
static void alloc_segment(void)
{
@@ -198,7 +199,7 @@ static void alloc_segment(void)
check(fd < 0, "memfd_create");
if (use_secret) {
- ret = ioctl(fd, MFD_SECRET_EXCLUSIVE);
+ ret = ioctl(fd, secret_option);
check(ret < 0, "ioctl");
}
@@ -245,6 +246,8 @@ void __attribute__ ((constructor)) preload_setup(void)
debug = atoi(getenv("MALLOC_DEBUG"));
if (getenv("NO_SECRET_MEM") != NULL)
use_secret = 0;
+ if (getenv("SECRET_UNCACHED") != NULL)
+ secret_option = MFD_SECRET_UNCACHED;
m.free.fd = &m.free;
m.free.bk = &m.free;