UIO: mutex used in interrupt handler causes crash

Bug #1843487 reported by Tom Brezinski
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Undecided
Kamal Mostafa
Bionic
Fix Released
Medium
Kamal Mostafa

Bug Description

Running:
Bionic Beaver
Ubuntu 4.15.0-62.69-generic 4.15.18

Problem since: Ubuntu-4.15.0-59.66

In commit 725bbc87 on 2/13/2019 in uio.c a mutex_lock was added to uio_interrupt. This results in a "scheduling while atomic" error if someone else owns the mutex at the time it is invoked.

The following commit in the kernel mainline appears to fix this issue:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3d27c4de8d4fb2d4099ff324671792aa2578c6f9

description: updated
tags: added: bionic
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1843487

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Tom Brezinski (tbrezinski) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
Tom Brezinski (tbrezinski) wrote : CRDA.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : IwConfig.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : Lspci.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : Lsusb.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : ProcModules.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : PulseList.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : RfKill.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : UdevDb.txt

apport information

Revision history for this message
Tom Brezinski (tbrezinski) wrote : WifiSyslog.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Tom Brezinski (tbrezinski) wrote :
description: updated
description: updated
Changed in linux (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Kamal Mostafa (kamalmostafa)
Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

@Tom- Thanks for reporting this and isolating the cause and the fix. Here's a test kernel which includes a backport of the fix commit. Could you please verify that it resolves the problem?:

https://kernel.ubuntu.com/~kamal/lp1843487/

Revision history for this message
Tom Brezinski (tbrezinski) wrote :

@Kamal thanks for the quick response. I tried the files you sent over but it looks like I need some additional packages in order to rebuild my kernel module for that kernel. I tried to tell modprobe to force load my module built against 4.15.0-66 and it would not load it.

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

@Tom- Ah yes, you'll need the headers packages too, in order to build your own modules. OK, I've now added the two "linux-headers-*" packages to https://kernel.ubuntu.com/~kamal/lp1843487/ ... I believe you'll have to install the pair together.

Revision history for this message
Tom Brezinski (tbrezinski) wrote :

@Kamal yes this seems to fix it. I was able to run my device stress test for over 15 minutes. With the bug I was lucky if I could make it 15 seconds.

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

@Tom Sounds like a winner to me! I've submitted the patch to our process pipeline:
https://lists.ubuntu.com/archives/kernel-team/2019-October/105155.html

A post will appear here once it lands in a production Bionic kernel (most likely in our next three-week cycle, around 18-Nov).

Thanks again for doing the leg-work on this!

Changed in linux (Ubuntu Bionic):
assignee: nobody → Kamal Mostafa (kamalmostafa)
status: New → In Progress
Stefan Bader (smb)
Changed in linux (Ubuntu Bionic):
importance: Undecided → Medium
Changed in linux (Ubuntu Bionic):
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the 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-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

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-bionic
Revision history for this message
Tom Brezinski (tbrezinski) wrote :

Verified fix in proposed 4.15.0-71-generic.

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

This bug was fixed in the package linux - 4.15.0-72.81

---------------
linux (4.15.0-72.81) bionic; urgency=medium

  * bionic/linux: 4.15.0-72.81 -proposed tracker (LP: #1854027)

  * [Regression] Bionic kernel 4.15.0-71.80 can not boot on ThunderX
    (LP: #1853326)
    - Revert "arm64: Use firmware to detect CPUs that are not affected by
      Spectre-v2"
    - Revert "arm64: Get rid of __smccc_workaround_1_hvc_*"

  * [Regression] Bionic kernel 4.15.0-71.80 can not boot on ThunderX2 and
    Kunpeng920 (LP: #1852723)
    - SAUCE: arm64: capabilities: Move setup_boot_cpu_capabilities() call to
      correct place

linux (4.15.0-71.80) bionic; urgency=medium

  * bionic/linux: 4.15.0-71.80 -proposed tracker (LP: #1852289)

  * Bionic update: upstream stable patchset 2019-10-29 (LP: #1850541)
    - panic: ensure preemption is disabled during panic()
    - f2fs: use EINVAL for superblock with invalid magic
    - [Config] updateconfigs for USB_RIO500
    - USB: rio500: Remove Rio 500 kernel driver
    - USB: yurex: Don't retry on unexpected errors
    - USB: yurex: fix NULL-derefs on disconnect
    - USB: usb-skeleton: fix runtime PM after driver unbind
    - USB: usb-skeleton: fix NULL-deref on disconnect
    - xhci: Fix false warning message about wrong bounce buffer write length
    - xhci: Prevent device initiated U1/U2 link pm if exit latency is too long
    - xhci: Check all endpoints for LPM timeout
    - usb: xhci: wait for CNR controller not ready bit in xhci resume
    - USB: adutux: fix use-after-free on disconnect
    - USB: adutux: fix NULL-derefs on disconnect
    - USB: adutux: fix use-after-free on release
    - USB: iowarrior: fix use-after-free on disconnect
    - USB: iowarrior: fix use-after-free on release
    - USB: iowarrior: fix use-after-free after driver unbind
    - USB: usblp: fix runtime PM after driver unbind
    - USB: chaoskey: fix use-after-free on release
    - USB: ldusb: fix NULL-derefs on driver unbind
    - serial: uartlite: fix exit path null pointer
    - USB: serial: keyspan: fix NULL-derefs on open() and write()
    - USB: serial: ftdi_sio: add device IDs for Sienna and Echelon PL-20
    - USB: serial: option: add Telit FN980 compositions
    - USB: serial: option: add support for Cinterion CLS8 devices
    - USB: serial: fix runtime PM after driver unbind
    - USB: usblcd: fix I/O after disconnect
    - USB: microtek: fix info-leak at probe
    - USB: dummy-hcd: fix power budget for SuperSpeed mode
    - usb: renesas_usbhs: gadget: Do not discard queues in
      usb_ep_set_{halt,wedge}()
    - usb: renesas_usbhs: gadget: Fix usb_ep_set_{halt,wedge}() behavior
    - USB: legousbtower: fix slab info leak at probe
    - USB: legousbtower: fix deadlock on disconnect
    - USB: legousbtower: fix potential NULL-deref on disconnect
    - USB: legousbtower: fix open after failed reset request
    - USB: legousbtower: fix use-after-free on release
    - staging: vt6655: Fix memory leak in vt6655_probe
    - iio: adc: ad799x: fix probe error handling
    - iio: adc: axp288: Override TS pin bias current for some models
    - iio: light: opt3001: fix mutex unlock race
    - efivar/ssdt: Don't iterate over EFI va...

Changed in linux (Ubuntu Bionic):
status: Fix Committed → Fix Released
Po-Hsu Lin (cypressyew)
Changed in linux (Ubuntu):
status: In Progress → Invalid
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.