From: mpi Date: Fri, 17 Dec 2021 14:18:15 +0000 (+0000) Subject: Do not try to unlock a NULL object. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f08b8e936de962e196a0ac3cccc2fd86ce3f0f30;p=openbsd 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 --- 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; }