From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH 21/22] libxc: range checks in xc_dom_p2m_host and _guest Date: Wed, 12 Jun 2013 19:26:17 +0100 Message-ID: <20130612182617.GA45409@ocelot.phlegethon.org> References: <1370974865-19554-1-git-send-email-ian.jackson@eu.citrix.com> <1370974865-19554-22-git-send-email-ian.jackson@eu.citrix.com> <20920.40058.635699.510629@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20920.40058.635699.510629@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: George Dunlap , Andrew Cooper , "xen-devel@lists.xensource.com" , mattjd@gmail.com, security@xen.org List-Id: xen-devel@lists.xenproject.org At 17:06 +0100 on 12 Jun (1371056778), Ian Jackson wrote: > George Dunlap writes ("Re: [Xen-devel] [PATCH 21/22] libxc: range checks in xc_dom_p2m_host and _guest"): > > On Tue, Jun 11, 2013 at 7:21 PM, Ian Jackson wrote: > > > These functions take guest pfns and look them up in the p2m. They did > > > no range checking. > > > > > > However, some callers, notably xc_dom_boot.c:setup_hypercall_page want > > > to pass untrusted guest-supplied value(s). It is most convenient to > > > detect this here and return INVALID_MFN. > > > > > > This is part of the fix to a security issue, XSA-55. > > > > > > Signed-off-by: Ian Jackson > > > Cc: Tim Deegan > > > > I've taken a look at where things get returned here, and it seems like > > they should all be OK with INVALID_MFN. > > Good. Does that mean that we should promote the check to be done in > the shadow_enabled case too ? No - did my last reply to this get lost? The check is not needed for shadow-translated guests as Xen will refuse any invalid mapping requests anyway -- AFAICS the check just protects the array access. For HVM guests, adding this check would be incorrect, as they can have pfns > tot-pages. Tim.