diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2678,6 +2678,12 @@ kve->kve_protection |= KVME_PROT_WRITE; if (entry->protection & VM_PROT_EXECUTE) kve->kve_protection |= KVME_PROT_EXEC; + if (entry->max_protection & VM_PROT_READ) + kve->kve_protection |= KVME_MAX_PROT_READ; + if (entry->max_protection & VM_PROT_WRITE) + kve->kve_protection |= KVME_MAX_PROT_WRITE; + if (entry->max_protection & VM_PROT_EXECUTE) + kve->kve_protection |= KVME_MAX_PROT_EXEC; if (entry->eflags & MAP_ENTRY_COW) kve->kve_flags |= KVME_FLAG_COW; diff --git a/sys/sys/user.h b/sys/sys/user.h --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -506,6 +506,9 @@ #define KVME_PROT_READ 0x00000001 #define KVME_PROT_WRITE 0x00000002 #define KVME_PROT_EXEC 0x00000004 +#define KVME_MAX_PROT_READ 0x00010000 +#define KVME_MAX_PROT_WRITE 0x00020000 +#define KVME_MAX_PROT_EXEC 0x00040000 #define KVME_FLAG_COW 0x00000001 #define KVME_FLAG_NEEDS_COPY 0x00000002