Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Oct 2019 17:58:20 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353956 - head/sys/vm
Message-ID:  <201910231758.x9NHwK3Z079093@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Wed Oct 23 17:58:19 2019
New Revision: 353956
URL: https://svnweb.freebsd.org/changeset/base/353956

Log:
  Verify identity after checking for WAITFAIL in vm_page_busy_acquire().
  
  A caller that does not guarantee that a page's identity won't change
  while sleeping for a busy lock must specify either NOWAIT or WAITFAIL.
  
  Reported by:	syzkaller
  Reviewed by:	alc, kib
  Discussed with:	jeff
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D22124

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Wed Oct 23 17:53:20 2019	(r353955)
+++ head/sys/vm/vm_page.c	Wed Oct 23 17:58:19 2019	(r353956)
@@ -900,9 +900,11 @@ vm_page_busy_acquire(vm_page_t m, int allocflags)
 		    (allocflags & VM_ALLOC_SBUSY) != 0, locked);
 		if (locked)
 			VM_OBJECT_WLOCK(obj);
-		MPASS(m->object == obj || m->object == NULL);
 		if ((allocflags & VM_ALLOC_WAITFAIL) != 0)
 			return (FALSE);
+		KASSERT(m->object == obj || m->object == NULL,
+		    ("vm_page_busy_acquire: page %p does not belong to %p",
+		    m, obj));
 	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910231758.x9NHwK3Z079093>