From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR2gB-0004PM-Lj for qemu-devel@nongnu.org; Tue, 01 Oct 2013 12:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VR2fy-0005yv-3S for qemu-devel@nongnu.org; Tue, 01 Oct 2013 12:20:07 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:33816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR2fx-0005xi-CT for qemu-devel@nongnu.org; Tue, 01 Oct 2013 12:19:54 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Oct 2013 21:49:48 +0530 From: "Aneesh Kumar K.V" Date: Tue, 1 Oct 2013 21:49:30 +0530 Message-Id: <1380644373-15500-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com> In-Reply-To: <1380644373-15500-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1380644373-15500-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V4 RESEND 3/6] target-ppc: Check for error on address translation in memsave command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: agraf@suse.de, paulus@samba.org Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, "Aneesh Kumar K.V" From: "Aneesh Kumar K.V" When we translate the virtual address to physical check for error. Signed-off-by: Aneesh Kumar K.V --- cpus.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index e566297..52470a6 100644 --- a/cpus.c +++ b/cpus.c @@ -1333,7 +1333,10 @@ void qmp_memsave(int64_t addr, int64_t size, const char *filename, l = sizeof(buf); if (l > size) l = size; - cpu_memory_rw_debug(cpu, addr, buf, l, 0); + if (cpu_memory_rw_debug(cpu, addr, buf, l, 0) != 0) { + error_setg(errp, "Invalid addr 0x%016" PRIx64 "specified", addr); + goto exit; + } if (fwrite(buf, 1, l, f) != l) { error_set(errp, QERR_IO_ERROR); goto exit; -- 1.8.1.2