From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [BUGFIX][PATCH 3/4] hvm_save_one: return correct data. Date: Tue, 07 Jan 2014 15:55:39 +0000 Message-ID: References: <52B7401A.5070809@terremark.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 1W0Z0R-0005bI-At for xen-devel@lists.xenproject.org; Tue, 07 Jan 2014 15:55:51 +0000 Received: by mail-wg0-f46.google.com with SMTP id m15so315465wgh.13 for ; Tue, 07 Jan 2014 07:55:49 -0800 (PST) In-Reply-To: <52B7401A.5070809@terremark.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: Don Slutz , Andrew Cooper Cc: xen-devel , Ian Jackson , Ian Campbell , Jan Beulich , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 22/12/2013 19:40, "Don Slutz" wrote: > On 12/16/13 13:33, Andrew Cooper wrote: > > Not sure why it took till late 12/21 for me to get this e-mail. > >> On 16/12/2013 17:51, Don Slutz wrote: >>> On 12/16/13 03:17, Jan Beulich wrote: >>>>>>> On 15.12.13 at 17:51, Andrew Cooper wrote: >>>>> On 15/12/2013 00:29, Don Slutz wrote: > [snip] >> Your loop condition needs to change be "off < (ctxt.cur - >> sizeof(*desc))" otherwise the "off += sizeof(*desc)" can wander beyond >> ctxt.cur in the loop body. You also need to verify that the >> copy_to_guest doesn't exceed ctxt.cur. > fixed. >> Stylistically, "desc = (void *)ctxt.data + off;" needs to be "desc = >> (void *)(ctxt.data + off);" as the latter is standards compliment C >> while the former is UB which GCC has an extension to deal with sensibly. > fixed. >> Also you have a double space before sizeof in "off += sizeof(*desc);" > Fixed. Version 4 attached. Acked-by: Keir Fraser >> ~Andrew >> > -Don Slutz