Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Oct 2011 05:42:53 +0000 (UTC)
From:      "Jayachandran C." <jchandra@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r226459 - head/sys/mips/mips
Message-ID:  <201110170542.p9H5gro3097024@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jchandra
Date: Mon Oct 17 05:42:53 2011
New Revision: 226459
URL: http://svn.freebsd.org/changeset/base/226459

Log:
  Fix for crash on MIPS /dev/mem read.
  
  Reading /dev/mem in 64 bit kernel crashes.  This is because the page
  used to call uiomove_fromphys() from memrw() does not have md.pv_list
  initialized correctly.
  
  The fix is to call pmap_page_init() on the page to initialize it.

Modified:
  head/sys/mips/mips/mem.c

Modified: head/sys/mips/mips/mem.c
==============================================================================
--- head/sys/mips/mips/mem.c	Mon Oct 17 05:41:03 2011	(r226458)
+++ head/sys/mips/mips/mem.c	Mon Oct 17 05:42:53 2011	(r226459)
@@ -87,6 +87,7 @@ memrw(struct cdev *dev, struct uio *uio,
 
 	GIANT_REQUIRED;
 
+	pmap_page_init(&m);
 	while (uio->uio_resid > 0 && !error) {
 		iov = uio->uio_iov;
 		if (iov->iov_len == 0) {



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