lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d84b239-3901-f995-765b-97b7574d0d74@redhat.com>
Date:   Fri, 13 Dec 2019 11:55:10 +0100
From:   Auger Eric <eric.auger@...hat.com>
To:     Marc Zyngier <maz@...nel.org>
Cc:     eric.auger.pro@...il.com, linux-kernel@...r.kernel.org,
        kvmarm@...ts.cs.columbia.edu
Subject: Re: [PATCH] KVM: arm/arm64: vgic-its: Fix restoration of unmapped
 collections

Hi Marc,

On 12/13/19 11:43 AM, Marc Zyngier wrote:
> Hi Eric,
> 
> On 2019-12-13 09:42, Eric Auger wrote:
>> Saving/restoring an unmapped collection is a valid scenario. For
>> example this happens if a MAPTI command was sent, featuring an
>> unmapped collection. At the moment the CTE fails to be restored.
>> Only compare against the number of online vcpus if the rdist
>> base is set.
>>
>> Cc: stable@...r.kernel.org # v4.11+
>> Fixes: ea1ad53e1e31a ("KVM: arm64: vgic-its: Collection table
>> save/restore")
>> Signed-off-by: Eric Auger <eric.auger@...hat.com>
>> ---
>>  virt/kvm/arm/vgic/vgic-its.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
>> index 98c7360d9fb7..17920d1b350a 100644
>> --- a/virt/kvm/arm/vgic/vgic-its.c
>> +++ b/virt/kvm/arm/vgic/vgic-its.c
>> @@ -2475,7 +2475,8 @@ static int vgic_its_restore_cte(struct vgic_its
>> *its, gpa_t gpa, int esz)
>>      target_addr = (u32)(val >> KVM_ITS_CTE_RDBASE_SHIFT);
>>      coll_id = val & KVM_ITS_CTE_ICID_MASK;
>>
>> -    if (target_addr >= atomic_read(&kvm->online_vcpus))
>> +    if (target_addr != COLLECTION_NOT_MAPPED &&
>> +        target_addr >= atomic_read(&kvm->online_vcpus))
>>          return -EINVAL;
>>
>>      collection = find_collection(its, coll_id);
> 
> Looks good to me. Out of curiosity, how was this spotted?

I am currently writing some kvm-unit-tests to better test ITS and its
migration.

Thanks

Eric
> 
> Thanks,
> 
>         M.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ