xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: patches@linaro.org, ian.campbell@citrix.com,
	Julien Grall <julien.grall@linaro.org>,
	Stefano.Stabellini@eu.citrix.com
Subject: [PATCH 1/3] xen/arm: Don't emulate the MMIO access if the instruction syndrome is invalid
Date: Tue, 23 Jul 2013 19:05:11 +0100	[thread overview]
Message-ID: <1374602713-716-2-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1374602713-716-1-git-send-email-julien.grall@linaro.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 <julien.grall@linaro.org>
---
 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

  reply	other threads:[~2013-07-23 18:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 18:05 [PATCH 0/3] Add support for THUMB guest kernel Julien Grall
2013-07-23 18:05 ` Julien Grall [this message]
2013-07-23 22:10   ` [PATCH 1/3] xen/arm: Don't emulate the MMIO access if the instruction syndrome is invalid Ian Campbell
2013-07-23 18:05 ` [PATCH 2/3] xen/arm: Allow secondary cpus to start in THUMB Julien Grall
2013-07-23 18:12   ` Ian Campbell
2013-07-23 21:28     ` Julien Grall
2013-07-23 22:07       ` Ian Campbell
2013-07-23 22:09         ` Julien Grall
2013-07-23 18:05 ` [PATCH 3/3] xen/arm: errata 766422: decode thumb store during data abort Julien Grall
2013-07-23 18:18   ` Ian Campbell
2013-07-23 21:41     ` Julien Grall
2013-07-23 22:16       ` Ian Campbell
2013-07-23 22:43         ` Julien Grall
2013-07-24 14:55           ` Ian Campbell
2013-07-24 15:19             ` Julien Grall
2013-07-29 14:46               ` Tim Deegan
2013-07-29 14:55                 ` Ian Campbell
2013-07-29 14:56                 ` Julien Grall
2013-07-29 15:00                   ` Ian Campbell
2013-07-29 15:04                     ` Julien Grall
2013-07-29 15:15                       ` Ian Campbell
2013-07-23 18:10 ` [PATCH 0/3] Add support for THUMB guest kernel Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374602713-716-2-git-send-email-julien.grall@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=patches@linaro.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).