From: "Jan Beulich" <JBeulich@suse.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
nmanthey@amazon.de, Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH 3/4] x86/vPIC: avoid speculative out of bounds accesses
Date: Thu, 31 Jan 2019 07:26:34 -0700 [thread overview]
Message-ID: <5C53059A0200007800212CB6@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <5C5301290200007800212C6B@prv1-mh.provo.novell.com>
Array indexes used in the I/O port read/write emulation functions are
derived from guest controlled values. Where this is not already done,
restrict their ranges to limit the side effects of speculative execution.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -335,7 +335,7 @@ static int vpic_intercept_pic_io(
return X86EMUL_OKAY;
}
- vpic = ¤t->domain->arch.hvm.vpic[port >> 7];
+ vpic = ¤t->domain->arch.hvm.vpic[!!(port & 0x80)];
if ( dir == IOREQ_WRITE )
vpic_ioport_write(vpic, port, (uint8_t)*val);
@@ -448,7 +448,7 @@ void vpic_init(struct domain *d)
void vpic_irq_positive_edge(struct domain *d, int irq)
{
- struct hvm_hw_vpic *vpic = &d->arch.hvm.vpic[irq >> 3];
+ struct hvm_hw_vpic *vpic = &d->arch.hvm.vpic[!!(irq & 8)];
uint8_t mask = 1 << (irq & 7);
ASSERT(has_vpic(d));
@@ -466,7 +466,7 @@ void vpic_irq_positive_edge(struct domai
void vpic_irq_negative_edge(struct domain *d, int irq)
{
- struct hvm_hw_vpic *vpic = &d->arch.hvm.vpic[irq >> 3];
+ struct hvm_hw_vpic *vpic = &d->arch.hvm.vpic[!!(irq & 8)];
uint8_t mask = 1 << (irq & 7);
ASSERT(has_vpic(d));
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-01-31 14:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-31 14:07 [PATCH 0/4] x86: further L1TF / XSA-289 guards Jan Beulich
2019-01-31 14:25 ` [PATCH 1/4] x86emul: avoid speculative out of bounds accesses Jan Beulich
2019-01-31 14:54 ` Andrew Cooper
2019-01-31 15:50 ` Jan Beulich
2019-01-31 16:14 ` Andrew Cooper
2019-01-31 16:45 ` Jan Beulich
2019-02-07 11:42 ` [PATCH v2] " Jan Beulich
2019-07-04 13:19 ` [Xen-devel] " Andrew Cooper
2019-04-03 8:46 ` Ping: " Jan Beulich
2019-01-31 14:26 ` [PATCH 2/4] x86/vMSI: " Jan Beulich
2019-07-04 13:27 ` [Xen-devel] " Andrew Cooper
2019-01-31 14:26 ` Jan Beulich [this message]
2019-07-04 13:35 ` [Xen-devel] [PATCH 3/4] x86/vPIC: " Andrew Cooper
2019-01-31 14:27 ` [PATCH 4/4] x86/vLAPIC: " Jan Beulich
2019-07-04 13:44 ` [Xen-devel] " Andrew Cooper
2019-07-04 13:57 ` Jan Beulich
[not found] ` <5C53012902000000001030F5@prv1-mh.provo.novell.com>
[not found] ` <5C53012902000078002328D1@prv1-mh.provo.novell.com>
2019-05-27 9:24 ` Ping: [PATCH 0/4] x86: further L1TF / XSA-289 guards Jan Beulich
2019-05-27 9:24 ` [Xen-devel] " Jan Beulich
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=5C53059A0200007800212CB6@prv1-mh.provo.novell.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=jgross@suse.com \
--cc=nmanthey@amazon.de \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.