Re: [PATCH] KVM: x86: Fix TSS size check for 16-bit tasks

2010-03-23 Thread Avi Kivity

On 03/23/2010 01:21 PM, Jan Kiszka wrote:



A 44-byte TSS has a limit of 43 (just like a 4GB segment has a limit of
0x), so there is an off-by-one here.

 

Right - you just found an (harmless) off-by-one in our legacy OS as well
(I blindly copied its limit).

   


It's a very common error.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] KVM: x86: Fix TSS size check for 16-bit tasks

2010-03-23 Thread Jan Kiszka
Avi Kivity wrote:
> On 03/23/2010 12:25 PM, Avi Kivity wrote:
>>> This should be stable material as well. I can provide a patch that
>>> applies on .32 and .33, or what will be the procedure?
>>
>> I'd like to drop the Cc: stable and maintain stable queues explicitly
>> (in kvm-updates/2.6.3[23]).  I'll fast-forward these to current
>> -stable, please send patches against them.  These branches will be
>> autotested before submission, a step that is missing in the current
>> scheme of things.
> 
> kvm.git now has these branches updated.
> 

6c1535244cc930a0307ea0708a2063e4f4b34158 ("Add
KVM_CAP_X86_ROBUST_SINGLESTEP") in the 2.6.33 branch is damaged. "Update
instruction length on intercepted BP" is missing in the 2.6.32 queue,
but Greg should have queued this up already.

Jan



signature.asc
Description: OpenPGP digital signature


Re: [PATCH] KVM: x86: Fix TSS size check for 16-bit tasks

2010-03-23 Thread Jan Kiszka
Avi Kivity wrote:
> On 03/22/2010 12:29 PM, Jan Kiszka wrote:
>> A 16-bit TSS is only 44 bytes long. So make sure to test for the correct
>> size on task switch.
>>
> 
>> This should be stable material as well. I can provide a patch that
>> applies on .32 and .33, or what will be the procedure?
>>
> 
> I'd like to drop the Cc: stable and maintain stable queues explicitly
> (in kvm-updates/2.6.3[23]).  I'll fast-forward these to current -stable,
> please send patches against them.  These branches will be autotested
> before submission, a step that is missing in the current scheme of things.
> 
>>
>> -if (!next_tss_desc.p || desc_limit_scaled(&next_tss_desc)<  0x67) {
>> +desc_limit = desc_limit_scaled(&next_tss_desc);
>> +if (!next_tss_desc.p ||
>> +((desc_limit<  0x67&&  (next_tss_desc.type&  8)) ||
>> + desc_limit<  0x2c)) {
>>
> 
> A 44-byte TSS has a limit of 43 (just like a 4GB segment has a limit of
> 0x), so there is an off-by-one here.
> 

Right - you just found an (harmless) off-by-one in our legacy OS as well
(I blindly copied its limit).

Jan



signature.asc
Description: OpenPGP digital signature


Re: [PATCH] KVM: x86: Fix TSS size check for 16-bit tasks

2010-03-23 Thread Avi Kivity

On 03/23/2010 12:25 PM, Avi Kivity wrote:

This should be stable material as well. I can provide a patch that
applies on .32 and .33, or what will be the procedure?


I'd like to drop the Cc: stable and maintain stable queues explicitly 
(in kvm-updates/2.6.3[23]).  I'll fast-forward these to current 
-stable, please send patches against them.  These branches will be 
autotested before submission, a step that is missing in the current 
scheme of things.


kvm.git now has these branches updated.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] KVM: x86: Fix TSS size check for 16-bit tasks

2010-03-23 Thread Avi Kivity

On 03/22/2010 12:29 PM, Jan Kiszka wrote:

A 16-bit TSS is only 44 bytes long. So make sure to test for the correct
size on task switch.
   



This should be stable material as well. I can provide a patch that
applies on .32 and .33, or what will be the procedure?
   


I'd like to drop the Cc: stable and maintain stable queues explicitly 
(in kvm-updates/2.6.3[23]).  I'll fast-forward these to current -stable, 
please send patches against them.  These branches will be autotested 
before submission, a step that is missing in the current scheme of things.




-   if (!next_tss_desc.p || desc_limit_scaled(&next_tss_desc)<  0x67) {
+   desc_limit = desc_limit_scaled(&next_tss_desc);
+   if (!next_tss_desc.p ||
+   ((desc_limit<  0x67&&  (next_tss_desc.type&  8)) ||
+desc_limit<  0x2c)) {
   


A 44-byte TSS has a limit of 43 (just like a 4GB segment has a limit of 
0x), so there is an off-by-one here.


--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html