[Hyper-V] Drivers: hv: vmbus: Fix ring buffer signaling

Bug #1748662 reported by Joshua R. Poulson on 2018-02-10
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-azure (Ubuntu)
Undecided
Marcelo Cerri
Xenial
Undecided
Marcelo Cerri
Bionic
Undecided
Marcelo Cerri

Bug Description

Fix bugs in signaling the Hyper-V host when freeing space in the
host->guest ring buffer:

1. The interrupt_mask must not be used to determine whether to signal
   on the host->guest ring buffer
2. The ring buffer write_index must be read (via hv_get_bytes_to_write)
   *after* pending_send_sz is read in order to avoid a race condition
3. Comparisons with pending_send_sz must treat the "equals" case as
   not-enough-space
4. Don't signal if the pending_send_sz feature is not present. Older
   versions of Hyper-V that don't implement this feature will poll.

Fixes: 03bad714a161 ("vmbus: more host signalling avoidance")

This patch is on its way upstream but has not yet been accepted into char-misc. It should apply to 4.4+ kernels that have taken 03bad714a161

tags: added: patch
Joshua R. Poulson (jrp) on 2018-02-10
Changed in linux-azure (Ubuntu):
status: New → Confirmed
Marcelo Cerri (mhcerri) wrote :

In linux-azure, we have a set of custom changes on top of hv_pkt_iter_close(). The provided fix partially overlaps with bug #1731994. Because of that, I'm reverting #1731994 and applying the patch on top of that.

Can MS confirm if that is the right approach?

Thank you.

Marcelo Cerri (mhcerri) wrote :

We will include this change in the following release.

Joshua R. Poulson (jrp) wrote :

From the log it seems pretty different from upstream because we backported some cool stuff:
https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-azure/log/drivers/hv/ring_buffer.c?h=master-next

Age Commit message (Expand)
Author
2 days UBUNTU: SAUCE: vmbus: fix performance regression
Stephen Hemminger
2 days UBUNTU: SAUCE: vmbus: simplify packet iterator
Stephen Hemminger
2 days UBUNTU: SAUCE: vmbus: don't need to check interrupt mask on read side
Stephen Hemminger

I think we can back out the changes in the three sauce items above and apply the patch cleanly. In the meantime when we sync up to 4.15 this should be easier to clean up.

Marcelo Cerri (mhcerri) on 2018-03-01
Changed in linux-azure (Ubuntu Xenial):
status: New → In Progress
assignee: nobody → Marcelo Cerri (mhcerri)
Changed in linux-azure (Ubuntu Bionic):
assignee: nobody → Marcelo Cerri (mhcerri)
Marcelo Cerri (mhcerri) on 2018-03-07
Changed in linux-azure (Ubuntu Xenial):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :
Download full text (38.7 KiB)

This bug was fixed in the package linux-azure - 4.15.0-1002.2

---------------
linux-azure (4.15.0-1002.2) bionic; urgency=medium

  * linux-azure: 4.15.0-1002.2 -proposed tracker (LP: #1749771)

  * CVE-2017-5715 (Spectre v2 retpoline)
    - [Config] azure: disable retpoline checks for another upload

  * [Hyper-V] Fixes for Network Direct InfiniBand/RDMA driver (LP: #1749332)
    - SAUCE: vmbus-rdma: ND142: don't wait forever for disconnection from remote
      connector
    - SAUCE: vmbus-rdma: ND142: remove idr handle before calling ND on freeing CQ
      and QP
    - SAUCE: vmbus-rdma: ND142: do not crash on idr allocation failure - warn
      instead
    - SAUCE: vmbus-rdma: ND144: don't wait forever for disconnection from remote
      connector
    - SAUCE: vmbus-rdma: ND144: remove idr handle before calling ND on freeing CQ
      and QP
    - SAUCE: vmbus-rdma: ND144: do not crash on idr allocation failure - warn
      instead

  * [Hyper-V] Drivers: hv: vmbus: Fix ring buffer signaling (LP: #1748662)
    - Revert "UBUNTU: SAUCE: vmbus: fix performance regression"
    - SAUCE: hv: vmbus: Fix ring buffer signaling

  * Update the source code location in the debian package for cloud kernels
    (LP: #1747890)
    - [Debian] Update git repository URI

  * Miscellaneous upstream changes
    - [Config] updateconfigs after rebase to Ubuntu-4.15.0-10.11

  [ Ubuntu: 4.15.0-10.11 ]

  * linux: 4.15.0-10.11 -proposed tracker (LP: #1749250)
  * "swiotlb: coherent allocation failed" dmesg spam with linux 4.15.0-9.10
    (LP: #1749202)
    - swiotlb: suppress warning when __GFP_NOWARN is set
    - drm/ttm: specify DMA_ATTR_NO_WARN for huge page pools
  * linux-tools: perf incorrectly linking libbfd (LP: #1748922)
    - SAUCE: tools -- add ability to disable libbfd
    - [Packaging] correct disablement of libbfd
  * [Artful] Realtek ALC225: 2 secs noise when a headset plugged in
    (LP: #1744058)
    - ALSA: hda/realtek - update ALC225 depop optimize
  * [Artful] Support headset mode for DELL WYSE (LP: #1723913)
    - SAUCE: ALSA: hda/realtek - Add support headset mode for DELL WYSE
  * headset mic can't be detected on two Dell machines (LP: #1748807)
    - ALSA: hda/realtek - Support headset mode for ALC215/ALC285/ALC289
    - ALSA: hda - Fix headset mic detection problem for two Dell machines
  * Bionic update to v4.15.3 stable release (LP: #1749191)
    - ip6mr: fix stale iterator
    - net: igmp: add a missing rcu locking section
    - qlcnic: fix deadlock bug
    - qmi_wwan: Add support for Quectel EP06
    - r8169: fix RTL8168EP take too long to complete driver initialization.
    - tcp: release sk_frag.page in tcp_disconnect
    - vhost_net: stop device during reset owner
    - ipv6: addrconf: break critical section in addrconf_verify_rtnl()
    - ipv6: change route cache aging logic
    - Revert "defer call to mem_cgroup_sk_alloc()"
    - net: ipv6: send unsolicited NA after DAD
    - rocker: fix possible null pointer dereference in
      rocker_router_fib_event_work
    - tcp_bbr: fix pacing_gain to always be unity when using lt_bw
    - cls_u32: add missing RCU annotation.
    - ipv6: Fix SO_REUSEPORT UDP socket with implicit sk_ipv6onl...

Changed in linux-azure (Ubuntu Bionic):
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-azure - 4.13.0-1012.15

---------------
linux-azure (4.13.0-1012.15) xenial; urgency=medium

  * linux-azure: 4.13.0-1012.15 -proposed tracker (LP: #1751799)

  * Enable secure boot on linux-azure (LP: #1754042)
    - Revert "UBUNTU: [debian] azure: do not build uefi signed binary"

  * [Hyper-v] Set CONFIG_I2C_PIIX4 to "n" (LP: #1752999)
    - [Config] azure: CONFIG_I2C_PIIX4=n

  * [Hyper-V] Drivers: hv: vmbus: Fix ring buffer signaling (LP: #1748662)
    - Revert "UBUNTU: SAUCE: vmbus: fix performance regression"
    - Revert "UBUNTU: SAUCE: vmbus: simplify packet iterator"
    - Revert "UBUNTU: SAUCE: vmbus: don't need to check interrupt mask on read
      side"
    - SAUCE: hv: vmbus: Fix ring buffer signaling

  * [Hyper-V] set config: CONFIG_EDAC_DECODE_MCE=y (LP: #1751123)
    - [Config] azure: CONFIG_EDAC_DECODE_MCE=y

 -- Marcelo Henrique Cerri <email address hidden> Wed, 07 Mar 2018 13:37:00 -0300

Changed in linux-azure (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers