[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [PATCH-for-4.1 v2 1/3] virtio-balloon: fix QEMU crashe
From: |
David Hildenbrand |
Subject: |
Re: [Qemu-stable] [PATCH-for-4.1 v2 1/3] virtio-balloon: fix QEMU crashes on pagesize > BALLOON_PAGE_SIZE |
Date: |
Thu, 18 Jul 2019 13:50:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 |
On 18.07.19 05:50, David Gibson wrote:
> On Wed, Jul 17, 2019 at 12:35:48PM +0200, David Hildenbrand wrote:
>> We are using the wrong functions to set/clear bits, effectively touching
>> multiple bits, writing out of range of the bitmap, resulting in memory
>> corruptions. We have to use set_bit()/clear_bit() instead.
>>
>> Can easily be reproduced by starting a qemu guest on hugetlbfs memory,
>> inflating the balloon. QEMU crashes. This never could have worked
>> properly - especially, also pages would have been discarded when the
>> first sub-page would be inflated (the whole bitmap would be set).
>>
>> While testing I realized, that on hugetlbfs it is pretty much impossible
>> to discard a page - the guest just frees the 4k sub-pages in random order
>> most of the time. I was only able to discard a hugepage a handful of
>> times - so I hope that now works correctly.
>>
>> Fixes: ed48c59875b6 ("virtio-balloon: Safely handle BALLOON_PAGE_SIZE <
>> host page size")
>> Fixes: b27b32391404 ("virtio-balloon: Fix possible guest memory corruption
>> with inflates & deflates")
>> Cc: address@hidden #v4.0.0
>> Cc: Stefan Hajnoczi <address@hidden>
>> Cc: David Gibson <address@hidden>
>> Cc: Michael S. Tsirkin <address@hidden>
>> Cc: Igor Mammedov <address@hidden>
>> Signed-off-by: David Hildenbrand <address@hidden>
>
> Ahem. You can pass me the brown paper bag now.
>
No worries, BUGs are inevitable.
Thanks!
--
Thanks,
David / dhildenb