From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: [PATCH 1/9] x86/mm: Don't dereference p2m pointer before NULL check. Date: Thu, 12 Sep 2013 13:15:22 +0100 Message-ID: <1378988130-24172-2-git-send-email-tim@xen.org> References: <1378988130-24172-1-git-send-email-tim@xen.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1378988130-24172-1-git-send-email-tim@xen.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: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Not a security bug, because in fact this is never called with a NULL argument. Coverity CID 1055955 Signed-off-by: Tim Deegan --- xen/arch/x86/mm/p2m.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index f5ddd20..8f380ed 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -453,7 +453,7 @@ void p2m_teardown(struct p2m_domain *p2m) * We know we don't have any extra mappings to these pages */ { struct page_info *pg; - struct domain *d = p2m->domain; + struct domain *d; unsigned long gfn; p2m_type_t t; mfn_t mfn; @@ -461,6 +461,8 @@ void p2m_teardown(struct p2m_domain *p2m) if (p2m == NULL) return; + d = p2m->domain; + p2m_lock(p2m); /* Try to unshare any remaining shared p2m entries. Safeguard -- 1.7.10.4