summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2021-12-17 14:18:16 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2021-12-17 14:18:16 +0000
commitb46545b801f382e6ea8682095cd6bc75963b5866 (patch)
treefcc0c1c6a4e2ec6f0816cd23216b0bcc12d4cd6e /sys
parent62c6e032fae72fcce51d30b40fad9b3be39763de (diff)
Do not try to unlock a NULL object.
Fix a NULL dereference introduced in previous, reported by anton@ and Benjamin Baier. Reported-by: syzbot+c172bd335801b67e515b@syzkaller.appspotmail.com
Diffstat (limited to 'sys')
-rw-r--r--sys/uvm/uvm_fault.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c
index 4cd2efea1ec..dd709eb7aad 100644
--- a/sys/uvm/uvm_fault.c
+++ b/sys/uvm/uvm_fault.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_fault.c,v 1.122 2021/12/15 12:53:53 mpi Exp $ */
+/* $OpenBSD: uvm_fault.c,v 1.123 2021/12/17 14:18:15 mpi Exp $ */
/* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */
/*
@@ -1322,7 +1322,8 @@ uvm_fault_lower(struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
}
if (locked == FALSE) {
- rw_exit(uobj->vmobjlock);
+ if (uobjpage != PGO_DONTCARE)
+ rw_exit(uobj->vmobjlock);
return ERESTART;
}