Reserve WXNEEDED ELF feature control flag

This will be used to tag binaries that require W+X mappings, in advance
of the ability to prevent W^X in mmap/mprotect.

There is still some discussion about the flag's name, but the ABI won't
change even if the name does (as kib pointed out in the review).

Reviewed by:	csjp, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23909
This commit is contained in:
Ed Maste 2020-03-04 18:21:30 +00:00
parent ac09be5297
commit d06e23f9d9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358631
3 changed files with 3 additions and 0 deletions

View File

@ -3671,6 +3671,7 @@ static struct flag_desc note_feature_ctl_flags[] = {
{ NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" },
{ NT_FREEBSD_FCTL_PROTMAX_DISABLE, "PROTMAX_DISABLE" },
{ NT_FREEBSD_FCTL_STKGAP_DISABLE, "STKGAP_DISABLE" },
{ NT_FREEBSD_FCTL_WXNEEDED, "WXNEEDED" },
{ 0, NULL }
};

View File

@ -790,6 +790,7 @@ typedef struct {
#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001
#define NT_FREEBSD_FCTL_PROTMAX_DISABLE 0x00000002
#define NT_FREEBSD_FCTL_STKGAP_DISABLE 0x00000004
#define NT_FREEBSD_FCTL_WXNEEDED 0x00000008
/* Values for n_type. Used in core files. */
#define NT_PRSTATUS 1 /* Process status. */

View File

@ -66,6 +66,7 @@ static struct ControlFeatures featurelist[] = {
{ "protmax", NT_FREEBSD_FCTL_PROTMAX_DISABLE,
"Disable implicit PROT_MAX" },
{ "stackgap", NT_FREEBSD_FCTL_STKGAP_DISABLE, "Disable stack gap" },
{ "wxneeded", NT_FREEBSD_FCTL_WXNEEDED, "Requires W+X mappings" },
};
static struct option long_opts[] = {