From: kfraser@localhost.localdomain Date: Fri, 12 Jan 2007 14:51:27 +0000 (+0000) Subject: Fix xencomm_copy_{from, to}_guest. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15405^2~20 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=effd10be68d89702eb60070f8e1bb9b0eded0c07;p=xen.git Fix xencomm_copy_{from, to}_guest. It should not call paddr_to_maddr() with invalid address. Signed-off-by: Isaku Yamahata --- diff --git a/xen/common/xencomm.c b/xen/common/xencomm.c index f33c753934..8b7e502869 100644 --- a/xen/common/xencomm.c +++ b/xen/common/xencomm.c @@ -119,7 +119,7 @@ xencomm_copy_from_guest(void *to, const void *from, unsigned int n, 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 void *from, unsigned int n, 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);