qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 4290b4: migration/block-dirty-bitmap: make in


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 4290b4: migration/block-dirty-bitmap: make incoming disabl...
Date: Fri, 26 Mar 2021 03:22:34 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 4290b4834c4ffb9633a9851a9b932a147fcac928
      
https://github.com/qemu/qemu/commit/4290b4834c4ffb9633a9851a9b932a147fcac928
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M migration/block-dirty-bitmap.c

  Log Message:
  -----------
  migration/block-dirty-bitmap: make incoming disabled bitmaps busy

Incoming enabled bitmaps are busy, because we do
bdrv_dirty_bitmap_create_successor() for them. But disabled bitmaps
being migrated are not marked busy, and user can remove them during the
incoming migration. Then we may crash in cancel_incoming_locked() when
try to remove the bitmap that was already removed by user, like this:

 #0  qemu_mutex_lock_impl (mutex=0x5593d88c50d1, file=0x559680554b20
   "../block/dirty-bitmap.c", line=64) at ../util/qemu-thread-posix.c:77
 #1  bdrv_dirty_bitmaps_lock (bs=0x5593d88c0ee9)
   at ../block/dirty-bitmap.c:64
 #2  bdrv_release_dirty_bitmap (bitmap=0x5596810e9570)
   at ../block/dirty-bitmap.c:362
 #3  cancel_incoming_locked (s=0x559680be8208 <dbm_state+40>)
   at ../migration/block-dirty-bitmap.c:918
 #4  dirty_bitmap_load (f=0x559681d02b10, opaque=0x559680be81e0
   <dbm_state>, version_id=1) at ../migration/block-dirty-bitmap.c:1194
 #5  vmstate_load (f=0x559681d02b10, se=0x559680fb5810)
   at ../migration/savevm.c:908
 #6  qemu_loadvm_section_part_end (f=0x559681d02b10,
   mis=0x559680fb4a30) at ../migration/savevm.c:2473
 #7  qemu_loadvm_state_main (f=0x559681d02b10, mis=0x559680fb4a30)
   at ../migration/savevm.c:2626
 #8  postcopy_ram_listen_thread (opaque=0x0)
   at ../migration/savevm.c:1871
 #9  qemu_thread_start (args=0x5596817ccd10)
   at ../util/qemu-thread-posix.c:521
 #10 start_thread () at /lib64/libpthread.so.0
 #11 clone () at /lib64/libc.so.6

Note bs pointer taken from bitmap: it's definitely bad aligned. That's
because we are in use after free, bitmap is already freed.

So, let's make disabled bitmaps (being migrated) busy during incoming
migration.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210322094906.5079-2-vsementsov@virtuozzo.com>


  Commit: 3460fd7f3959d1fa7bcc255796844aa261c805a4
      
https://github.com/qemu/qemu/commit/3460fd7f3959d1fa7bcc255796844aa261c805a4
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test

  Log Message:
  -----------
  migrate-bitmaps-postcopy-test: check that we can't remove in-flight bitmaps

Check that we can't remove bitmaps being migrated on destination vm.
The new check proves that previous commit helps.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210322094906.5079-3-vsementsov@virtuozzo.com>


  Commit: 63ad23fa240bb7cdbf6d0440c5670cc7935032b0
      
https://github.com/qemu/qemu/commit/63ad23fa240bb7cdbf6d0440c5670cc7935032b0
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-03-25 (Thu, 25 Mar 2021)

  Changed paths:
    M migration/block-dirty-bitmap.c
    M tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/stefanha-gitlab/tags/block-pull-request' into staging

Pull request

This dirty bitmap fix solves a crash that can be triggered in the destination
QEMU process during live migration.

# gpg: Signature made Wed 24 Mar 2021 14:51:31 GMT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha-gitlab/tags/block-pull-request:
  migrate-bitmaps-postcopy-test: check that we can't remove in-flight bitmaps
  migration/block-dirty-bitmap: make incoming disabled bitmaps busy

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/9e2e9fe3df9f...63ad23fa240b



reply via email to

[Prev in Thread] Current Thread [Next in Thread]