Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kexec.c: add MFD_NOEXEC_SEAL flag explicitly #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion kexec/kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
#define KEXEC_LOADED_PATH "/sys/kernel/kexec_loaded"
#define KEXEC_CRASH_LOADED_PATH "/sys/kernel/kexec_crash_loaded"

#ifndef MFD_NOEXEC_SEAL
#define MFD_NOEXEC_SEAL 0
#endif

unsigned long long mem_min = 0;
unsigned long long mem_max = ULONG_MAX;
unsigned long elfcorehdrsz = 0;
Expand Down Expand Up @@ -655,7 +659,7 @@ static int copybuf_memfd(const char *kernel_buf, size_t size)
{
int fd, count;

fd = memfd_create("kernel", MFD_ALLOW_SEALING);
fd = memfd_create("kernel", MFD_ALLOW_SEALING | MFD_NOEXEC_SEAL);
if (fd == -1)
return fd;

Expand Down