From: Ian Campbell Subject: Re: [PATCH v5 09/10] xen/arm: Set foreign page type to p2m_map_foreign Date: Tue, 17 Dec 2013 11:34:11 +0000 Message-ID: <1387280051.27441.48.camel@kazak.uk.xensource.com> References: <1387215452-10951-1-git-send-email-julien.grall@linaro.org> <1387215452-10951-10-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vssul-00008A-KX for xen-devel@lists.xenproject.org; Tue, 17 Dec 2013 11:34:15 +0000 In-Reply-To: <1387215452-10951-10-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com, patches@linaro.org List-Id: xen-devel@lists.xenproject.org On Mon, 2013-12-16 at 17:37 +0000, Julien Grall wrote: > Xen needs to know that the current page belongs to another domain. Also take > a reference to this page. > > The current process to add a foreign page is: > 1) get the page from the foreign p2m > 2) take a reference on the page with the foreign domain in parameters > 3) add the page to the current domain p2m > > If the foreign domain drops the page: > - before 2), get_page will return NULL because the page doesn't > belong anymore to the domain > - after 2), the current domain already have a reference. Write will > occur to an old page which is not yet released. It can corrupt the foreign > domain. > > Signed-off-by: Julien Grall Acked-by: Ian Campbell Ian.