Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-122477

q-s-d deadlock when connecting NBD client to same process as server

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • None
    • Important
    • 1
    • rhel-virt-storage
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Patch Under review backlog
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • All
    • None

      What were you trying to do that didn't work?

      See https://gitlab.com/qemu-project/qemu/-/issues/3169.  The user was attempting to run qemu-storage-daemon to expose an NBD server on a qcow2 disk, then create a second qcow2 overlay with NBD as its backing file, and connect that overlay in the same q-s-d process.  The result is that q-s-d wedged itself in an uninterruptible state as both the client and server threads in the same process were trying to read from the same TCP socket during negotiation.

      What is the impact of this issue to you?

      Can't use a single q-s-d to export both parts of a qcow2 chain with an NBD backing in the middle.  Workaround was to use separate q-s-d for each part of the chain.

      Please provide the package NVR for which the bug is seen:

      qemu-kvm-10.0.0-14.el10_1 and others; original bug against latest qemu upstream

      How reproducible is this bug?:

      100%

      Steps to reproduce

      1. see qemu bug. In short, create qcow2 file, start q-s-d to expose it over NBD, create qcow2 file with NBD backing, instruct q-s-d to connect to the overlay.
      2. https://gitlab.com/qemu-project/qemu/-/issues/3169 (reproducer)
      3.  

      Expected results

      Ideally, a single q-s-d should be able to serve all parts of the qcow2 backing chain, even if it is communicating to itself between elements in the chain

      Actual results

      q-s-d wedges with both client and server thread polling for a read during NBD negotiation; with neither thread writing until it sees the response from the other end of the socket. The deadlock results in an inability to send SIGINT to q-s-d.

       

              eblake_redhat Eric Blake
              eblake_redhat Eric Blake
              virt-maint virt-maint
              Qinghua Cheng Qinghua Cheng
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: