From: "Jan Beulich" Subject: Re: [PATCH v2 2/4] xen: introduce grant_map_exists Date: Mon, 06 Oct 2014 11:20:46 +0100 Message-ID: <5432891E020000780003C678@mail.emea.novell.com> References: <1412347845-27755-2-git-send-email-stefano.stabellini@eu.citrix.com> <54326D50020000780003C589@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xb5PP-0006rN-2n for xen-devel@lists.xenproject.org; Mon, 06 Oct 2014 10:20:51 +0000 In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: julien.grall@citrix.com, xen-devel , Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 06.10.14 at 11:37, wrote: > On Mon, 6 Oct 2014, Jan Beulich wrote: >> >>> On 03.10.14 at 16:50, wrote: >> > + grant_ref_t ref; >> > + bool_t ret = 0; >> > + >> > + ASSERT(&rgt->lock); >> > + >> > + for ( ref = 0; ref != nr_grant_entries(rgt); ref++ ) >> >> This loop's worst case iteration count is controlled solely by the >> "gnttab_max_nr_frames=" command line option afaict, i.e. for a >> large enough specified value this is going to become a security >> issue. > > I am not sure what I could do about this. > Any suggestions? Sadly nothing simple (i.e. other than adding ways to do the reverse lookup). But I hope you agree that the lack of a good solution can't be a reason to introduce a security issue. And I'm not really fancying workarounds (like limiting the maximum) here... Jan