diff options
-rw-r--r-- | preload.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |