From bc6f027a39c4c7c2758de8f9d185653cad757784 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sun, 23 Aug 2020 19:47:27 +0000 Subject: [PATCH] Reserve FreeBSD ELF feature control bit LA48 to control VA layout on amd64. Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 --- sys/sys/elf_common.h | 1 + usr.bin/elfctl/elfctl.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index a13a694d29c5..7edfcfc9ca23 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -796,6 +796,7 @@ typedef struct { #define NT_FREEBSD_FCTL_PROTMAX_DISABLE 0x00000002 #define NT_FREEBSD_FCTL_STKGAP_DISABLE 0x00000004 #define NT_FREEBSD_FCTL_WXNEEDED 0x00000008 +#define NT_FREEBSD_FCTL_LA48 0x00000010 /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c index f371d9cd6f52..591258fad729 100644 --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -67,6 +67,7 @@ static struct ControlFeatures featurelist[] = { "Disable implicit PROT_MAX" }, { "stackgap", NT_FREEBSD_FCTL_STKGAP_DISABLE, "Disable stack gap" }, { "wxneeded", NT_FREEBSD_FCTL_WXNEEDED, "Requires W+X mappings" }, + { "la48", NT_FREEBSD_FCTL_LA48, "amd64: Limit user VA to 48bit" }, }; static struct option long_opts[] = {