svn commit: r353050 - stable/12/sys/kern
Mark Johnston
markj at FreeBSD.org
Thu Oct 3 14:54:27 UTC 2019
Author: markj
Date: Thu Oct 3 14:54:26 2019
New Revision: 353050
URL: https://svnweb.freebsd.org/changeset/base/353050
Log:
MFC r352748:
Fix handling of invalid pages in exec_map_first_page().
Modified:
stable/12/sys/kern/kern_exec.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/kern/kern_exec.c
==============================================================================
--- stable/12/sys/kern/kern_exec.c Thu Oct 3 14:52:25 2019 (r353049)
+++ stable/12/sys/kern/kern_exec.c Thu Oct 3 14:54:26 2019 (r353050)
@@ -996,7 +996,10 @@ exec_map_first_page(struct image_params *imgp)
vm_page_xbusy(ma[0]);
if (!vm_pager_has_page(object, 0, NULL, &after)) {
vm_page_lock(ma[0]);
- vm_page_free(ma[0]);
+ if (!vm_page_wired(ma[0]))
+ vm_page_free(ma[0]);
+ else
+ vm_page_xunbusy_maybelocked(ma[0]);
vm_page_unlock(ma[0]);
VM_OBJECT_WUNLOCK(object);
return (EIO);
@@ -1023,7 +1026,10 @@ exec_map_first_page(struct image_params *imgp)
if (rv != VM_PAGER_OK) {
for (i = 0; i < initial_pagein; i++) {
vm_page_lock(ma[i]);
- vm_page_free(ma[i]);
+ if (!vm_page_wired(ma[i]))
+ vm_page_free(ma[i]);
+ else
+ vm_page_xunbusy_maybelocked(ma[i]);
vm_page_unlock(ma[i]);
}
VM_OBJECT_WUNLOCK(object);
More information about the svn-src-all
mailing list