From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: Re: [XenPPC] [PATCH]fix xencomm_copy_{from, to}_guest. Date: Tue, 09 Jan 2007 13:24:02 -0600 Message-ID: <1168370642.15821.2.camel@thinkpad> References: <20070105031901.GA6574%yamahata@valinux.co.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-1FvDmdQcIrO2zf3ke3zL" Return-path: In-Reply-To: <20070105031901.GA6574%yamahata@valinux.co.jp> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Isaku Yamahata Cc: xen-ia64-devel@lists.xensource.com, xen-devel@lists.xensource.com, Hollis Blanchard , xen-ppc-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-1FvDmdQcIrO2zf3ke3zL Content-Type: text/plain Content-Transfer-Encoding: 7bit Keir, can you commit this patch to the tree. It has been tested and does not appear to cause any issues. Signed-off-by: Jerone Young On Fri, 2007-01-05 at 12:19 +0900, Isaku Yamahata wrote: > fix xencomm_copy_{from, to}_guest. > It should not call paddr_to_maddr() with invalid address. > > Originally this issue was found in xen/ia64 xencomm code and > in fact I didn't test this patch because currently ia64 xencomm forked > from common code. They should be consolidated somehow. > > -- > yamahata > _______________________________________________ > Xen-ppc-devel mailing list > Xen-ppc-devel@lists.xensource.com > http://lists.xensource.com/xen-ppc-devel --=-1FvDmdQcIrO2zf3ke3zL Content-Disposition: attachment; filename=13218_25cdcc5f21f8_fix_xencomm_copy_tofrom_guest.patch Content-Type: text/x-patch; name=13218_25cdcc5f21f8_fix_xencomm_copy_tofrom_guest.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User yamahata@valinux.co.jp # Date 1167966417 -32400 # Node ID 25cdcc5f21f8147371aed5fb8f56d93479df0ca8 # Parent 338ceb7b1f0993bf9735c0c1c5d21e39c381cf2f fix xencomm_copy_{from, to}_guest. It should not call paddr_to_maddr() with invalid address. PATCHNAME: fix_xencomm_copy_tofrom_guest Signed-off-by: Isaku Yamahata diff -r 338ceb7b1f09 -r 25cdcc5f21f8 xen/common/xencomm.c --- a/xen/common/xencomm.c Thu Jan 04 10:58:01 2007 +0000 +++ b/xen/common/xencomm.c Fri Jan 05 12:06:57 2007 +0900 @@ -119,7 +119,7 @@ xencomm_copy_from_guest(void *to, const chunksz -= chunk_skip; skip -= chunk_skip; - if (skip == 0) { + if (skip == 0 && chunksz > 0) { unsigned long src_maddr; unsigned long dest = (unsigned long)to + to_pos; unsigned int bytes = min(chunksz, n - to_pos); @@ -225,7 +225,7 @@ xencomm_copy_to_guest(void *to, const vo chunksz -= chunk_skip; skip -= chunk_skip; - if (skip == 0) { + if (skip == 0 && chunksz > 0) { unsigned long dest_maddr; unsigned long source = (unsigned long)from + from_pos; unsigned int bytes = min(chunksz, n - from_pos); --=-1FvDmdQcIrO2zf3ke3zL Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-1FvDmdQcIrO2zf3ke3zL--