Skip to content

Commit

Permalink
Fix redefine warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stanek-michal committed May 27, 2024
1 parent 34ca906 commit 73461e2
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions testing/test_bins/poc_memfd_create_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,6 @@ void load_so(int shm_fd) {

// Utility function to convert memfd_create flags to a JSON-friendly format
void flags_to_json(unsigned long flags, char *json, size_t json_size) {
// from linux/memfd.h:
//
/* flags for memfd_create(2) (unsigned int) */
#define MFD_CLOEXEC 0x0001U
#define MFD_ALLOW_SEALING 0x0002U
#define MFD_HUGETLB 0x0004U
/* not executable and sealed to prevent changing to executable. */
#define MFD_NOEXEC_SEAL 0x0008U
/* executable */
#define MFD_EXEC 0x0010U

snprintf(json, json_size, "{ \"value\": %lu, \"mfd_cloexec\": %s, \"mfd_allow_sealing\": %s, \"mfd_hugetlb\": %s, \"mfd_noexec_seal\": %s, \"mfd_exec\": %s }",
flags,
Expand Down

0 comments on commit 73461e2

Please sign in to comment.