diff options
author | John Baldwin <jhb@FreeBSD.org> | 2022-06-06 23:43:02 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2022-06-06 23:43:02 +0000 |
commit | 81c857dd7e6a83924a8e45684fb94024fc3c929b (patch) | |
tree | 7693f93714565d980cb2f7406c24c37d884deaa4 /usr.bin | |
parent | b831865fe3b8f66281b39a9cb567c92dc285a1da (diff) | |
download | src-81c857dd7e6a83924a8e45684fb94024fc3c929b.tar.gz src-81c857dd7e6a83924a8e45684fb94024fc3c929b.zip |
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/gcore/elfcore.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c index b0022d014e00..e5d7afd3f440 100644 --- a/usr.bin/gcore/elfcore.c +++ b/usr.bin/gcore/elfcore.c @@ -624,7 +624,9 @@ readmap(pid_t pid) errx(1, "out of memory"); ent->start = (vm_offset_t)kve->kve_start; ent->end = (vm_offset_t)kve->kve_end; - ent->protection = VM_PROT_READ | VM_PROT_WRITE; + ent->protection = VM_PROT_READ; + if ((kve->kve_protection & KVME_PROT_WRITE) != 0) + ent->protection |= VM_PROT_WRITE; if ((kve->kve_protection & KVME_PROT_EXEC) != 0) ent->protection |= VM_PROT_EXECUTE; |