From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Feng Wu <feng.wu@intel.com>,
Matt Wilson <msw@linux.com>, Eddie Dong <eddie.dong@intel.com>,
Donald Dugger <donald.d.dugger@intel.com>,
Xen-devel <xen-devel@lists.xen.org>,
Jun Nakajima <jun.nakajima@intel.com>,
Yang Zhang <yang.z.zhang@intel.com>, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86/hvm: Further restrict access to x2apic MSRs
Date: Fri, 17 Oct 2014 11:34:57 +0100 [thread overview]
Message-ID: <5440F0D1.70905@citrix.com> (raw)
In-Reply-To: <544104AB020000780003F845@mail.emea.novell.com>
On 17/10/14 10:59, Jan Beulich wrote:
>>>> On 16.10.14 at 20:04, <andrew.cooper3@citrix.com> wrote:
>> Therefore, direct the entire reserved range (0x840-0xbff) unconditionally at a
>> side effect of this change is that hvm_x2apic_msr_read() can now no longer
>> read beyond the bounds of the vlapic->regs array (which is 1/4 the size of the
>> page backing it).
> There seems to be stuff missing between "at" and "a"; at least I can't
> make sense of the sentence.
Oops. The paragraph read "...unconditionally at a\n#GP fault...". It
appears that git considered the line as a comment and dropped it from a
resulting message.
>
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -4355,8 +4355,9 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
>> *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
>> break;
>>
>> - case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
>> + case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3f:
>> if ( hvm_x2apic_msr_read(v, msr, msr_content) )
>> + case MSR_IA32_APICBASE_MSR + 0x40 ... MSR_IA32_APICBASE_MSR + 0x3ff:
>> goto gp_fault;
>> break;
>>
>> @@ -4482,8 +4483,9 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
>> vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
>> break;
>>
>> - case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
>> + case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3f:
>> if ( hvm_x2apic_msr_write(v, msr, msr_content) )
>> + case MSR_IA32_APICBASE_MSR + 0x40 ... MSR_IA32_APICBASE_MSR + 0x3ff:
>> goto gp_fault;
>> break;
>>
> I don't think this is done properly here. The ranges here should simply
> be extended back to cover the whole 1k range. Anything more specific
> should be contained to vlapic.c. And this "more specific" should likely
> include #GP on accesses to register indices 0, 1, 4..7, 9, 0xc, 0xe,
> 0x29..0x2e, and 0x3a..0x3d. I.e. extend the recent tightening,
> perhaps by fully switching to a white list in hvm_x2apic_msr_read()
> instead of the current black list approach, as otherwise what Matt
> said would still be wrong for all the listed registers.
Ok - I will see what I can do.
~Andrew
prev parent reply other threads:[~2014-10-17 10:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 18:04 [PATCH] x86/hvm: Further restrict access to x2apic MSRs Andrew Cooper
2014-10-17 8:54 ` Matt Wilson
2014-10-17 9:00 ` Andrew Cooper
2014-10-17 9:59 ` Jan Beulich
2014-10-17 10:34 ` Andrew Cooper [this message]
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=5440F0D1.70905@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=donald.d.dugger@intel.com \
--cc=eddie.dong@intel.com \
--cc=feng.wu@intel.com \
--cc=jun.nakajima@intel.com \
--cc=keir@xen.org \
--cc=kevin.tian@intel.com \
--cc=msw@linux.com \
--cc=xen-devel@lists.xen.org \
--cc=yang.z.zhang@intel.com \
/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.