From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoUTw-0007Ge-Fk for qemu-devel@nongnu.org; Wed, 12 Nov 2014 04:45:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoUTq-00087b-Bu for qemu-devel@nongnu.org; Wed, 12 Nov 2014 04:44:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoUTq-00087V-58 for qemu-devel@nongnu.org; Wed, 12 Nov 2014 04:44:50 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAC9intS007559 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 12 Nov 2014 04:44:49 -0500 Date: Wed, 12 Nov 2014 11:44:47 +0200 From: "Michael S. Tsirkin" Message-ID: <1415785203-26938-5-git-send-email-mst@redhat.com> References: <1415785203-26938-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1415785203-26938-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH 4/4] cpu: verify that block->host is set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , dgilbert@redhat.com, quintela@redhat.com If it isn't, access at an offset will cause memory corruption. Signed-off-by: Michael S. Tsirkin --- include/exec/cpu-all.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 7c3a5e7..62f5581 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -316,6 +316,7 @@ typedef struct RAMBlock { static inline void *ramblock_ptr(RAMBlock *block, ram_addr_t offset) { assert(offset < block->length); + assert(block->host); return (char *)block->host + offset; } -- MST