From: Dan Magenheimer Subject: xen crash in tmem: checking a xen pfn for domain ownership Date: Fri, 17 Sep 2010 09:29:54 -0700 (PDT) Message-ID: <5638cf67-e92c-45b3-8806-a0baba1eb8aa@default> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , Jan Beulich Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org Does the construct: xen_pfn_t gpfn; p2m_type_t t; unsigned long mfn; mfn =3D mfn_x(gfn_to_mfn(current->domain, gpfn, &t)); if (t !=3D p2m_ram_rw || cli_mfn =3D=3D INVALID_MFN) return NULL; /* bad */ return map_domain_page(mfn) somehow check to ensure that pfn belongs to current->domain? (See cli_mfn_to_va() in common/tmem_xen.c.) If not, is there an easy way to perform that check? (preferably one that works for both HVM and PV guests) In debugging a tmem Linux-side guest patch, I discovered that a bad mfn passed by the guest can crash Xen and I think this assumption might be the problem. Thanks, Dan