Azure 5.4: vDSO broken with 5.4.0-1075-azure

Bug #1977753 reported by Tim Gardner
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux-azure (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Medium
Tim Gardner

Bug Description

SRU Justification

[Impact]
vDSO works with the 5.4.0-1074-azure kernel, but is broken in 5.4.0-1075-azure and newer due to this commit
https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-azure/+git/bionic/commit/?h=Ubuntu-azure-5.4-5.4.0-1075.78_18.04.1&id=5c899e1bcda02c755a5327353ed66f0768771644

Please revert the commit 5c899e1bcda02c755a5327353ed66f0768771644.

How to verify vDSO is working: "strace date 2>&1 | grep time" should not show the time related syscalls, e.g. clock_gettime()
With 5.4.0-1075-azure and newer, I see the time related syscalls.

****************************************************************
More info:
The buggy commit 5c899e1bcda02c755a5327353ed66f0768771644 was backported from the mainline commit:
e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")
but due to the differences between the mainline kernel and the 5.4.0-107x-azure kernel, we actually should not simply remove hv_set_clocksource_vdso().

FWIW, the mainline commit is actually buggy and is fixed by this later mainline path:

commit 3486d2c9be652a31033363bdd50391b0c8a8fe21
Author: Vitaly Kuznetsov <email address hidden>
Date: Thu May 13 09:32:46 2021 +0200

clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86

Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029)
the commit e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO
differences inline") broke vDSO on x86. The problem appears to be that
VDSO_CLOCKMODE_HVCLOCK is an enum value in 'enum vdso_clock_mode' and
'#ifdef VDSO_CLOCKMODE_HVCLOCK' branch evaluates to false (it is not
a define).

Use a dedicated HAVE_VDSO_CLOCKMODE_HVCLOCK define instead.

Fixes: e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")
Reported-by: Mohammed Gamal <email address hidden>
Suggested-by: Thomas Gleixner <email address hidden>
Signed-off-by: Vitaly Kuznetsov <email address hidden>
Signed-off-by: Thomas Gleixner <email address hidden>
Reviewed-by: Michael Kelley <email address hidden>
Link: https://<email address hidden>

PS, Ubunt 20.04’s 5.13.0-1026-azure is not affected.

After some discussion it was decided that the revert is the best solution.

[Test Case]

strace date 2>&1 | grep time
also Microsoft tested

[Where things could go wrong]

vDSO entry point could stop working altogether

[Other Info]

SF: #00338309

CVE References

Tim Gardner (timg-tpi)
affects: linux (Ubuntu) → linux-azure (Ubuntu)
Changed in linux-azure (Ubuntu):
status: New → Fix Released
Changed in linux-azure (Ubuntu Focal):
assignee: nobody → Tim Gardner (timg-tpi)
importance: Undecided → Medium
status: New → In Progress
description: updated
Revision history for this message
Tim Gardner (timg-tpi) wrote :
Tim Gardner (timg-tpi)
Changed in linux-azure (Ubuntu Focal):
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-azure/5.4.0-1086.91 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
Tim Gardner (timg-tpi) wrote :

Microsoft tested

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (16.2 KiB)

This bug was fixed in the package linux-azure - 5.4.0-1086.91

---------------
linux-azure (5.4.0-1086.91) focal; urgency=medium

  * focal/linux-azure: 5.4.0-1086.91 -proposed tracker (LP: #1979462)

  * Focal update: upstream stable patchset v5.4.192 (LP: #1979014)
    - [Config] azure: updateconfigs for NVM, NVM_PBLK

  * focal/azure: The console log of ARM64 Ubuntu 18.04 has duplicate output
    (LP: #1976399)
    - printk: Move console matching logic into a separate function
    - printk: Fix preferred console selection with multiple matches

  * nbd: requests can become stuck when disconnecting from server with qemu-nbd
    (LP: #1896350)
    - blk-mq: blk-mq: provide forced completion method
    - blk-mq: move failure injection out of blk_mq_complete_request
    - nbd: don't handle response without a corresponding request message
    - nbd: make sure request completion won't concurrent
    - nbd: don't clear 'NBD_CMD_INFLIGHT' flag if request is not completed
    - nbd: fix io hung while disconnecting device

  * Azure 5.4: vDSO broken with 5.4.0-1075-azure (LP: #1977753)
    - Revert "clocksource/drivers/hyper-v: Handle vDSO differences inline"

  [ Ubuntu: 5.4.0-122.138 ]

  * focal/linux: 5.4.0-122.138 -proposed tracker (LP: #1979489)
  * Remove SAUCE patches from test_vxlan_under_vrf.sh in net of
    ubuntu_kernel_selftests (LP: #1975691)
    - Revert "UBUNTU: SAUCE: selftests: net: Don't fail test_vxlan_under_vrf on
      xfail"
    - Revert "UBUNTU: SAUCE: selftests: net: Make test for VXLAN underlay in non-
      default VRF an expected failure"
  * Enable Asus USB-BT500 Bluetooth dongle(0b05:190e) (LP: #1976613)
    - Bluetooth: btusb: Add flag to define wideband speech capability
    - Bluetooth: btrtl: Add support for RTL8761B
    - Bluetooth: btusb: Add 0x0b05:0x190e Realtek 8761BU (ASUS BT500) device.
  * [UBUNTU 20.04] rcu stalls with many storage key guests (LP: #1975582)
    - s390/gmap: voluntarily schedule during key setting
    - s390/mm: use non-quiescing sske for KVM switch to keyed guest
  * Ubuntu 5.4.0-117.132-generic 5.4.189 has BUG: kernel NULL pointer
    dereference, address: 0000000000000034 (LP: #1978719)
    - mm: rmap: explicitly reset vma->anon_vma in unlink_anon_vmas()
  * Focal update: upstream stable patchset v5.4.192 (LP: #1979014)
    - floppy: disable FDRAWCMD by default
    - [Config] updateconfigs for BLK_DEV_FD_RAWCMD
    - hamradio: defer 6pack kfree after unregister_netdev
    - hamradio: remove needs_free_netdev to avoid UAF
    - lightnvm: disable the subsystem
    - [Config] updateconfigs for NVM, NVM_PBLK
    - usb: mtu3: fix USB 3.0 dual-role-switch from device to host
    - USB: quirks: add a Realtek card reader
    - USB: quirks: add STRING quirk for VCOM device
    - USB: serial: whiteheat: fix heap overflow in WHITEHEAT_GET_DTR_RTS
    - USB: serial: cp210x: add PIDs for Kamstrup USB Meter Reader
    - USB: serial: option: add support for Cinterion MV32-WA/MV32-WB
    - USB: serial: option: add Telit 0x1057, 0x1058, 0x1075 compositions
    - xhci: stop polling roothubs after shutdown
    - xhci: increase usb U3 -> U0 link resume timeout from 100ms to 500ms
    - iio: dac: ad5592r: Fix...

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.