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

Failure to encode reply of domifaddr with ARP source

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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.2.0, rhel-9.7
    • libvirt
    • None
    • None
    • Low
    • rhel-virt-core-libvirt-1
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

      The following command to retrieve the VM interfaces using can fail when using VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP

      # virsh domifaddr rhel9 --source arp
      error: Failed to query for interfaces addresses
      error: Unable to encode message payload
      

      In the following situation:

      • The MAC adddress of one or more interfaces appears in the host's ARP table
      • These interfaces have no internal name (i.e. SR-IOV, user etc)

      NOTE: the customer use-case is SR-IOV

      Investigation:

      • The message encoding (XDR) fails probably due to a NULL in the name of the interface
      • Its not any problem with the ARP table or the message size, the logic just keeps trying to increase buffer as the encoding fails.
      • The message is not big at all, just a couple interfaces/MACs

      I can reproduce with an user interface on both these versions (9.2 and 9.7):

      • libvirt-9.0.0-10.3.el9_2.x86_64 (customer)
      • libvirt-10.10.0-15.4.el9_7.x86_64

      1. Setup a VM with an SR-IOV or user interface (possibly some other types too that have no interface name on the host).

      # virsh dumpxml rhel9 --xpath //domain//devices//interface
      <interface type="network">
        <mac address="52:54:00:4a:a1:82"/>
        <source network="default" portid="fed13f39-18fb-4510-a22e-6d4bbb27c1f3" bridge="virbr0"/>
        <target dev="vnet2"/>
        <model type="virtio"/>
        <boot order="2"/>
        <alias name="net0"/>
        <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
      </interface>
      <interface type="user">
        <mac address="52:54:00:4a:a1:ff"/>
        <model type="rtl8139"/>
        <backend type="passt"/>
        <alias name="net1"/>
        <address type="pci" domain="0x0000" bus="0x10" slot="0x01" function="0x0"/>
      </interface>
      

      2. Now add that user interface MAC to the system ARP table, so libvirt finds the user interface MAC in the system ARP table from the netlink reply

      ip neigh add 1.2.3.4 dev virbr0 lladdr 52:54:00:4a:a1:ff nud reachable
      

      3. Fail

      # virsh domifaddr rhel9 --source arp
      error: Failed to query for interfaces addresses
      error: Unable to encode message payload
      

      4. There is a null in the name of the user interface:

      (gdb) b qemuDomainInterfaceAddresses
      (gdb) c
      
      Thread 20 "rpc-virtqemud" hit Breakpoint 1, qemuDomainInterfaceAddresses (dom=0x7f6f280072e0, ifaces=0x7f6f749f78b8, source=2, flags=0) at ../src/qemu/qemu_driver.c:18793
      
      (gdb) 
      18831	        ret = virDomainNetARPInterfaces(vm->def, ifaces);
      (gdb) n
      18842	    virDomainObjEndAPI(&vm);
      (gdb) p ret
      $3 = 2
      
      (gdb) p *(virDomainInterface *)(*ifaces)[0]
      $7 = {name = 0x7f6f6c0013f0 "vnet2", hwaddr = 0x7f6f6c001410 "52:54:00:4a:a1:82", naddrs = 1, addrs = 0x7f6f6c004f80}
      (gdb) p *(virDomainInterface *)(*ifaces)[1]
      $8 = {name = 0x0, hwaddr = 0x7f6f6c0039e0 "52:54:00:4a:a1:ff", naddrs = 1, addrs = 0x7f6f6c002470}
      

              virt-maint virt-maint
              rhn-support-gveitmic Germano Veit Michel
              virt-maint virt-maint
              virt-bugs virt-bugs
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: