kinfo_vmentry: report max protection

Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46971
This commit is contained in:
Konstantin Belousov 2024-10-07 10:49:43 +03:00
parent 88a198af3c
commit 409c2fa385
2 changed files with 9 additions and 0 deletions

View file

@ -2678,6 +2678,12 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags)
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;

View file

@ -506,6 +506,9 @@ struct kinfo_lockf {
#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