From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH 18/23] libxc: Add range checking to xc_dom_binloader Date: Fri, 14 Jun 2013 16:19:04 +0100 Message-ID: <51BB3468.6060004@eu.citrix.com> References: <1371147302-20767-1-git-send-email-ian.jackson@eu.citrix.com> <1371147302-20767-19-git-send-email-ian.jackson@eu.citrix.com> <20923.12455.79753.831636@mariner.uk.xensource.com> <51BB321B.80800@eu.citrix.com> <20923.13137.527678.760500@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20923.13137.527678.760500@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: Andrew Cooper , "xen-devel@lists.xensource.com" , mattjd@gmail.com, security@xen.org List-Id: xen-devel@lists.xenproject.org On 14/06/13 16:14, Ian Jackson wrote: > George Dunlap writes ("Re: [Xen-devel] [PATCH 18/23] libxc: Add range checking to xc_dom_binloader"): >> if ( dom->kernel-size - sizeof(*table) > 8192) >> ptr_end = dom->kernel_blob + 8192 >> else >> ptr_end = dom->kernel_size - sizeof(*table); >> >> Or something along those lines? > Yes, I said something similar to Chuck. Except that your code has a > bug if kernel_size < sizeof(*table) :-). ...no, because that's already checked by the previous hunk of your patch. :-) > TBH I think I'd rather not disturb this any more than necessary. I think disturbing it in a way that is obviously correct is better than disturbing it in a way that looks redundant. But I do think that the code in the patch you have, while unnecessarily confusing and likely to trip someone up down the road, will do what the patch claims it will do. -George