Skip to content

Build failure without CONFIG_OPENPAX_SOFTMODE enabled #1

@tofurky

Description

@tofurky

Hi, thanks for publishing this. I ran into a small issue during build against master (but confirmed stable branches are also affected).

fs/binfmt_elf.c references pax_softmode regardless of whether CONFIG_OPENPAX_SOFTMODE is set, but it's only declared in init/main.c if it's enabled via config.

I wrapped the conditional with #ifdef in binfmt_elf.c to fix the build like follows:

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index cf9bff48f180..fa0102bdc738 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -864,10 +864,14 @@ static int openpax_set_flags(struct file * const file, const int snapshot_random
                set_bit(PAXF_RANDMMAP, &current->mm->pax_flags);
        }
 
+#ifdef CONFIG_OPENPAX_SOFTMODE
        if (!pax_softmode) {
+#endif
                set_bit(PAXF_PAGEEXEC, &current->mm->pax_flags);
                set_bit(PAXF_MPROTECT, &current->mm->pax_flags);
+#ifdef CONFIG_OPENPAX_SOFTMODE
        }
+#endif
 
 #ifdef CONFIG_OPENPAX_EMUTRAMP_DEFAULT
        set_bit(PAXF_EMUTRAMP, &current->mm->pax_flags);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions