diff options
author | Mike Rapoport <rppt@linux.ibm.com> | 2020-05-25 22:00:53 +0300 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2020-05-27 07:06:38 -0700 |
commit | e664743c81fd5ba89b9294b9d4ec665248228581 (patch) | |
tree | 28c41c8790b982add78bae3a1743498061048b47 | |
parent | 5237f266dcff55147779ba4be903fcca07c598d0 (diff) | |
download | secret-memory-preloader-e664743c81fd5ba89b9294b9d4ec665248228581.tar.gz |
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
-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; |