On 16/11/2023 04:52, Aditya Deshpande wrote:
[...]
diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index f01f1f99cf03..3ebbab3cf92f 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -188,21 +188,26 @@ do { \ NEW_AUX_ENT(AT_IGNORE, 0); \ } while (0) +#define ARCH_HAS_SETUP_ADDITIONAL_PAGES +struct linux_binprm;
#ifdef CONFIG_CHERI_PURECAP_UABI +extern int purecap_setup_additional_pages(struct linux_binprm *bprm,
int uses_interp);
+#define arch_setup_additional_pages purecap_setup_additional_pages /*
- TODO [PCuABI]: In Transitional PCuABI, AT_SYSINFO_EHDR is passed as NULL
- as there is no purecap vDSO yet.
- TODO [PCuABI]: Look into restricting the bounds of this capability to just
*/
- the vDSO pages, as currently the bounds are of the root user capability.
-#define ARCH_DLINFO SETUP_DLINFO(0) +#define ARCH_DLINFO SETUP_DLINFO(uaddr_to_user_ptr_safe(\ +(elf_addr_t)current->mm->context.vdso))
Nit: should be indented (typically at the level of the opening parenthesis). Another nit, there is normally a space before continuation backslashes.
#else /* !CONFIG_CHERI_PURECAP_UABI */ +extern int aarch64_setup_additional_pages(struct linux_binprm *bprm,
int uses_interp);
This declaration can be moved next to #define ARCH_HAS_SETUP... / struct linux_binprm; above (you chose the right place to move them to, that's where they were originally). We are always using this function (either in native or compat64), so it's simpler to define it in just one place, and it makes the diff easier to digest.
+#define arch_setup_additional_pages aarch64_setup_additional_pages #define ARCH_DLINFO SETUP_DLINFO((elf_addr_t)current->mm->context.vdso) #endif /* CONFIG_CHERI_PURECAP_UABI */ [...]
+static int __init purecap_vdso_init(void) {
{ is always in its own line when defining a function (it gets confusing when initialising globals as in that case { is at the end of the line).
Kevin