]> Git Repo - J-linux.git/commitdiff
binfmt_elf: Wire up AT_HWCAP3 at AT_HWCAP4
authorMark Brown <[email protected]>
Fri, 4 Oct 2024 20:26:29 +0000 (21:26 +0100)
committerCatalin Marinas <[email protected]>
Thu, 17 Oct 2024 17:38:49 +0000 (18:38 +0100)
AT_HWCAP3 and AT_HWCAP4 were recently defined for use on PowerPC in commit
3281366a8e79 ("uapi/auxvec: Define AT_HWCAP3 and AT_HWCAP4 aux vector,
entries"). Since we want to start using AT_HWCAP3 on arm64 add support for
exposing both these new hwcaps via binfmt_elf.

Signed-off-by: Mark Brown <[email protected]>
Acked-by: Kees Cook <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/compat_binfmt_elf.c

index 06dc4a57ba78a7939bbde96bf181eefa950ea13a..3039a6b7aba4bd38f26e21b626b579cc03f3a03e 100644 (file)
@@ -257,6 +257,12 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec,
        NEW_AUX_ENT(AT_RANDOM, (elf_addr_t)(unsigned long)u_rand_bytes);
 #ifdef ELF_HWCAP2
        NEW_AUX_ENT(AT_HWCAP2, ELF_HWCAP2);
+#endif
+#ifdef ELF_HWCAP3
+       NEW_AUX_ENT(AT_HWCAP3, ELF_HWCAP3);
+#endif
+#ifdef ELF_HWCAP4
+       NEW_AUX_ENT(AT_HWCAP4, ELF_HWCAP4);
 #endif
        NEW_AUX_ENT(AT_EXECFN, bprm->exec);
        if (k_platform) {
index 4fe5bb9f1b1f5e0be6e8d1ef5b20492935b90633..31d253bd3961a8679678c600f4346bba23502598 100644 (file)
@@ -623,6 +623,12 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
        NEW_AUX_ENT(AT_HWCAP,   ELF_HWCAP);
 #ifdef ELF_HWCAP2
        NEW_AUX_ENT(AT_HWCAP2,  ELF_HWCAP2);
+#endif
+#ifdef ELF_HWCAP3
+       NEW_AUX_ENT(AT_HWCAP3,  ELF_HWCAP3);
+#endif
+#ifdef ELF_HWCAP4
+       NEW_AUX_ENT(AT_HWCAP4,  ELF_HWCAP4);
 #endif
        NEW_AUX_ENT(AT_PAGESZ,  PAGE_SIZE);
        NEW_AUX_ENT(AT_CLKTCK,  CLOCKS_PER_SEC);
index 8f0af4f626316ed2e92204ff9bf381cd14103ae9..d5ef5469e4e620f6ee97f40ce9cbbfa48e37e33c 100644 (file)
 #define        ELF_HWCAP2              COMPAT_ELF_HWCAP2
 #endif
 
+#ifdef COMPAT_ELF_HWCAP3
+#undef ELF_HWCAP3
+#define        ELF_HWCAP3              COMPAT_ELF_HWCAP3
+#endif
+
+#ifdef COMPAT_ELF_HWCAP4
+#undef ELF_HWCAP4
+#define        ELF_HWCAP4              COMPAT_ELF_HWCAP4
+#endif
+
 #ifdef COMPAT_ARCH_DLINFO
 #undef ARCH_DLINFO
 #define        ARCH_DLINFO             COMPAT_ARCH_DLINFO
This page took 0.082042 seconds and 4 git commands to generate.