Skip to content

Commit

Permalink
Fix memfd includes
Browse files Browse the repository at this point in the history
  • Loading branch information
stanek-michal committed Jun 3, 2024
1 parent 3ce5adf commit c572c2c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions testing/test_bins/poc_memfd_create_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <sys/syscall.h>
#include <sys/utsname.h>
#include <unistd.h>
#include <linux/memfd.h>

#ifdef __aarch64__
#include "malware/malware_elf_binary_arm64.h"
Expand Down Expand Up @@ -100,9 +101,18 @@ void flags_to_json(unsigned long flags, char *json, size_t json_size) {
flags,
(flags & MFD_CLOEXEC) ? "true" : "false",
(flags & MFD_ALLOW_SEALING) ? "true" : "false",
(flags & MFD_HUGETLB) ? "true" : "false",
(flags & MFD_NOEXEC_SEAL) ? "true" : "false",
(flags & MFD_EXEC) ? "true" : "false");
(flags & MFD_HUGETLB) ? "true" : "false"
#if defined(MFD_NOEXEC_SEAL)
,(flags & MFD_NOEXEC_SEAL) ? "true" : "false"
#else
,"false"
#endif
#if defined(MFD_EXEC)
,(flags & MFD_EXEC) ? "true" : "false"
#else
,"false"
#endif
);
}

int main (int argc, char **argv) {
Expand Down

0 comments on commit c572c2c

Please sign in to comment.