From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH v2 1/3] xen/arm: Don't emulate the MMIO access if the instruction syndrome is invalid Date: Thu, 25 Jul 2013 16:21:30 +0100 Message-ID: <1374765692-31370-2-git-send-email-julien.grall@linaro.org> References: <1374765692-31370-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1374765692-31370-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: patches@linaro.org, ian.campbell@citrix.com, Julien Grall , Stefano.Stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org When the instruction syndrome is not valid, the transfer register is unknown. If this register is used in the emulation code (it's the case for the VGIC), Xen can retrieve wrong data. For safety, consider invalid instruction syndrome as wrong memory access. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/traps.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index bbd60aa..d6dc37d 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -1017,6 +1017,10 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs, if ( rc == -EFAULT ) goto bad_data_abort; + /* XXX: Decode the instruction if ISS is not valid */ + if ( !dabt.valid ) + goto bad_data_abort; + if (handle_mmio(&info)) { regs->pc += dabt.len ? 4 : 2; -- 1.7.10.4