CVE-2018-10902
High · 7.8CVSS
7.8
EPSS
0.5%
Published
Aug 21, 2018
CISA due date
—
Cloudanix analysis
A problem in the part of Linux that handles certain music devices lets someone who is already logged in take over the whole computer.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Moderate
- Impact
- Privilege Gain
- Component
- OS kernel
- Class
- Use After Free
- Remediation
- Patch
- Effort
- Medium
- Patch risk
- Low
What it actually does
Concurrent access to raw MIDI devices in the kernel driver triggers a double-free condition in snd_rawmidi_input_params and snd_rawmidi_output_status during ioctl handling, resulting in a use-after-free that can be leveraged for arbitrary code execution with kernel privileges.
Why it matters to the business
Local attackers who already have a foothold on a Linux system can escalate to full root access, potentially compromising the entire host and any workloads or data it protects; the issue has been addressed in upstream kernels for nearly six years, so unpatched older distributions remain exposed.
How an attack unfolds
An attacker with local access opens a raw MIDI device, issues concurrent ioctl calls that race in snd_rawmidi_ioctl, triggers the double realloc, and uses the resulting use-after-free to corrupt kernel structures and execute code with elevated privileges.
How to fix it
Upgrade the Linux kernel to a version containing commit 39675f7a7c7e7702f7d5341f1e0d01db746543a0 or later; apply the corresponding security update from the distribution vendor for the running kernel series.
How to confirm the fix worked
Confirm the running kernel commit or package version includes 39675f7a7c7e7702f7d5341f1e0d01db746543a0; attempt to load the snd-rawmidi module and verify that concurrent ioctl calls no longer produce kernel warnings or crashes indicative of the double-free.
Typical attack path
- Obtain local shell on target Linux system
- Identify presence of raw MIDI device nodes or load the snd-rawmidi module
- Craft and run a multithreaded program that opens the device and issues racing input/output parameter ioctls
- Trigger double-free to obtain a controllable kernel pointer
- Overwrite function pointers or credentials to gain root
How to detect it
Review kernel logs for repeated rawmidi ioctl warnings, use-after-free crashes, or auditd records of unusual access to raw MIDI device nodes; correlate with user sessions that suddenly gain root privileges without sudo logs.
What your security team should do
- Prioritize kernel updates on any systems still running kernels older than the 2018 fix commit
- Restrict local user access to /dev/snd/*rawmidi devices via udev rules or group membership where MIDI functionality is not required
- Monitor kernel update channels for backported fixes in LTS distributions
The record
It was found that the raw midi kernel driver does not protect against concurrent access which leads to a double realloc (double free) in snd_rawmidi_input_params() and snd_rawmidi_output_status() which are part of snd_rawmidi_ioctl() handler in rawmidi.c file. A malicious local attacker could possibly use this for privilege escalation.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Chainguard | hyperv-daemons | 0 | 0 |
| Chainguard | hyperv-daemons-6.12 | 0 | 0 |
| Chainguard | hyperv-daemons-6.18 | 0 | 0 |
| Chainguard | hyperv-daemons-generic | 0 | 0 |
| Chainguard | linux | 0 | 0 |
| Chainguard | linux-aws-6.12 | 0 | 6.12.63-r0 |
| Chainguard | linux-aws-6.12 | 0 | 6.12.65-r0 |
| Chainguard | linux-aws-6.12-boot-installed | 0 | 0 |
| Chainguard | linux-aws-6.12-fips-boot-installed | 0 | 0 |
| Chainguard | linux-aws-6.12-headers | 0 | 0 |
| Chainguard | linux-aws-6.12-modules | 0 | 0 |
| Chainguard | linux-aws-6.18 | 0 | 6.18.4-r0 |
| Chainguard | linux-aws-6.18-boot-installed | 0 | 0 |
| Chainguard | linux-aws-6.18-fips-boot-installed | 0 | 0 |
| Chainguard | linux-aws-6.18-headers | 0 | 0 |
| Chainguard | linux-aws-6.18-modules | 0 | 0 |
| Chainguard | linux-aws-generic | 0 | 6.18.3-r0 |
| Chainguard | linux-aws-generic | 0 | 6.18.5-r0 |
| Chainguard | linux-aws-generic-boot-configuration | 0 | 0 |
| Chainguard | linux-aws-generic-boot-installed | 0 | 0 |
| Chainguard | linux-aws-generic-fips-boot-installed | 0 | 0 |
| Chainguard | linux-aws-generic-headers | 0 | 0 |
| Chainguard | linux-aws-generic-modules | 0 | 0 |
| Chainguard | linux-azure-6.12 | 0 | 6.12.63-r0 |
| Chainguard | linux-azure-6.12 | 0 | 6.12.65-r1 |
| Chainguard | linux-azure-6.12-boot-installed | 0 | 0 |
| Chainguard | linux-azure-6.12-fips-boot-installed | 0 | 0 |
| Chainguard | linux-azure-6.12-headers | 0 | 0 |
| Chainguard | linux-azure-6.12-modules | 0 | 0 |
| Chainguard | linux-azure-6.18 | 0 | 0 |
| Chainguard | linux-azure-6.18-boot-installed | 0 | 0 |
| Chainguard | linux-azure-6.18-fips-boot-installed | 0 | 0 |
| Chainguard | linux-azure-6.18-headers | 0 | 0 |
| Chainguard | linux-azure-6.18-modules | 0 | 0 |
| Chainguard | linux-azure-generic | 0 | 6.18.3-r0 |
| Chainguard | linux-azure-generic | 0 | 6.18.5-r0 |
| Chainguard | linux-azure-generic-boot-configuration | 0 | 0 |
| Chainguard | linux-azure-generic-boot-installed | 0 | 0 |
| Chainguard | linux-azure-generic-fips-boot-installed | 0 | 0 |
| Chainguard | linux-azure-generic-headers | 0 | 0 |
| Chainguard | linux-azure-generic-modules | 0 | 0 |
| Chainguard | linux-boot-configuration | 0 | 0 |
| Chainguard | linux-boot-installed | 0 | 0 |
| Chainguard | linux-gcp-6.12 | 0 | 6.12.63-r0 |
| Chainguard | linux-gcp-6.12 | 0 | 6.12.65-r0 |
| Chainguard | linux-gcp-6.12-boot-installed | 0 | 0 |
| Chainguard | linux-gcp-6.12-fips-boot-installed | 0 | 0 |
| Chainguard | linux-gcp-6.12-headers | 0 | 0 |
| Chainguard | linux-gcp-6.12-modules | 0 | 0 |
| Chainguard | linux-gcp-6.18 | 0 | 6.18.4-r0 |
| Chainguard | linux-gcp-6.18 | 0 | 6.18.7-r0 |
| Chainguard | linux-gcp-6.18-boot-installed | 0 | 0 |
| Chainguard | linux-gcp-6.18-fips-boot-installed | 0 | 0 |
| Chainguard | linux-gcp-6.18-headers | 0 | 0 |
| Chainguard | linux-gcp-6.18-modules | 0 | 0 |
| Chainguard | linux-gcp-generic | 0 | 6.18.3-r0 |
| Chainguard | linux-gcp-generic | 0 | 6.18.5-r0 |
| Chainguard | linux-gcp-generic-boot-installed | 0 | 0 |
| Chainguard | linux-gcp-generic-fips-boot-installed | 0 | 0 |
| Chainguard | linux-gcp-generic-headers | 0 | 0 |
| Chainguard | linux-gcp-generic-modules | 0 | 0 |
| Chainguard | linux-modules | 0 | 0 |
| Chainguard | linux-qemu-6.12-boot-installed | 0 | 6.12.63-r0 |
| Chainguard | linux-qemu-6.12-fips-boot-installed | 0 | 6.12.63-r0 |
| Chainguard | linux-qemu-6.12-headers | 0 | 6.12.63-r0 |
| Chainguard | linux-qemu-6.12-modules | 0 | 6.12.63-r0 |
| Chainguard | linux-qemu-6.18-boot-installed | 0 | 6.18.2-r0 |
| Chainguard | linux-qemu-6.18-fips-boot-installed | 0 | 6.18.2-r0 |
| Chainguard | linux-qemu-6.18-headers | 0 | 6.18.2-r0 |
| Chainguard | linux-qemu-6.18-modules | 0 | 6.18.2-r0 |
| Chainguard | linux-qemu-generic | 0 | 6.18.3-r0 |
| Chainguard | linux-qemu-generic | 0 | 6.18.5-r0 |
| Chainguard | linux-qemu-generic-boot-installed | 0 | 0 |
| Chainguard | linux-qemu-generic-bootc-boot-installed | 0 | 6.18.4-r0 |
| Chainguard | linux-qemu-generic-bootc-boot-installed | 0 | 6.18.5-r0 |
| Chainguard | linux-qemu-generic-fips-boot-installed | 0 | 0 |
| Chainguard | linux-qemu-generic-headers | 0 | 0 |
| Chainguard | linux-qemu-generic-modules | 0 | 0 |
| Chainguard | linux-qemu-rc | 0 | 6.19_rc4-r0 |
| Chainguard | linux-qemu-rc | 0 | 6.19_rc5-r0 |
| Chainguard | linux-qemu-rc-boot-installed | 0 | 0 |
| Chainguard | linux-qemu-rc-fips-boot-installed | 0 | 0 |
| Chainguard | linux-qemu-rc-headers | 0 | 0 |
| Chainguard | linux-qemu-rc-modules | 0 | 0 |
| Chainguard | linux-vmware-6.12-boot-installed | 0 | 6.12.63-r0 |
| Chainguard | linux-vmware-6.12-fips-boot-installed | 0 | 6.12.63-r0 |
| Chainguard | linux-vmware-6.12-headers | 0 | 6.12.63-r0 |
| Chainguard | linux-vmware-6.12-modules | 0 | 6.12.63-r0 |
| Chainguard | linux-vmware-6.18-boot-installed | 0 | 6.18.2-r0 |
| Chainguard | linux-vmware-6.18-fips-boot-installed | 0 | 6.18.2-r0 |
| Chainguard | linux-vmware-6.18-headers | 0 | 6.18.2-r0 |
| Chainguard | linux-vmware-6.18-modules | 0 | 6.18.2-r0 |
| Chainguard | linux-vmware-generic | 0 | 6.18.3-r0 |
| Chainguard | linux-vmware-generic | 0 | 6.18.5-r0 |
| Chainguard | linux-vmware-generic-boot-installed | 0 | 0 |
| Chainguard | linux-vmware-generic-fips-boot-installed | 0 | 0 |
| Chainguard | linux-vmware-generic-headers | 0 | 0 |
| Chainguard | linux-vmware-generic-modules | 0 | 0 |
| Debian:11 | linux | 0 | 4.17.15-1 |
| Debian:12 | linux | 0 | 4.17.15-1 |
| Debian:13 | linux | 0 | 4.17.15-1 |
| Debian:8 | linux | 0 | 3.16.59-1 |
| Debian:8 | linux-4.9 | 0 | 4.9.110-3+deb9u5~deb8u1 |
| Debian:9 | linux | 0 | 4.9.110-3+deb9u5 |
| Red Hat:enterprise_linux:6::client | kernel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-abi-whitelists | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-bootwrapper | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-debug | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-debug-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-debug-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-debuginfo-common-i686 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-debuginfo-common-ppc64 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-debuginfo-common-s390x | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-debuginfo-common-x86_64 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-doc | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-firmware | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-headers | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-kdump | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-kdump-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | kernel-kdump-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | perf | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | perf-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | python-perf | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::client | python-perf-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-abi-whitelists | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-bootwrapper | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-debug | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-debug-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-debug-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-debuginfo-common-i686 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-debuginfo-common-ppc64 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-debuginfo-common-s390x | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-debuginfo-common-x86_64 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-doc | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-firmware | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-headers | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-kdump | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-kdump-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | kernel-kdump-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | perf | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | perf-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | python-perf | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::computenode | python-perf-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-abi-whitelists | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-bootwrapper | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-debug | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-debug-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-debug-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-debuginfo-common-i686 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-debuginfo-common-ppc64 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-debuginfo-common-s390x | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-debuginfo-common-x86_64 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-doc | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-firmware | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-headers | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-kdump | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-kdump-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | kernel-kdump-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | perf | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | perf-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | python-perf | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::server | python-perf-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-abi-whitelists | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-bootwrapper | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-debug | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-debug-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-debug-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-debuginfo-common-i686 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-debuginfo-common-ppc64 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-debuginfo-common-s390x | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-debuginfo-common-x86_64 | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-doc | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-firmware | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-headers | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-kdump | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-kdump-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | kernel-kdump-devel | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | perf | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | perf-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | python-perf | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:6::workstation | python-perf-debuginfo | 0 | 0:2.6.32-754.11.1.el6 |
| Red Hat:enterprise_linux:7::client | bpftool | 0 | 0:3.10.0-957.el7 |
| Red Hat:enterprise_linux:7::client | kernel | 0 | 0:3.10.0-957.el7 |
| Red Hat:enterprise_linux:7::client | kernel-abi-whitelists | 0 | 0:3.10.0-957.el7 |
| Red Hat:enterprise_linux:7::client | kernel-bootwrapper | 0 | 0:3.10.0-957.el7 |
| Red Hat:enterprise_linux:7::client | kernel-debug | 0 | 0:3.10.0-957.el7 |
| Red Hat:enterprise_linux:7::client | kernel-debug-debuginfo | 0 | 0:3.10.0-957.el7 |
| Red Hat:enterprise_linux:7::client | kernel-debug-devel | 0 | 0:3.10.0-957.el7 |
| Red Hat:enterprise_linux:7::client | kernel-debuginfo | 0 | 0:3.10.0-957.el7 |
Related vulnerabilities
- CVE-2023-39180 A flaw was found within the handling of SMB2_READ commands in the kernel ksmbd module. Also affects hyperv-daemons
- CVE-2023-39179 A flaw was found within the handling of SMB2 read requests in the kernel ksmbd module. Also affects hyperv-daemons
- CVE-2023-39176 A flaw was found within the parsing of SMB2 requests that have a transform header in the… Also affects hyperv-daemons
- CVE-2023-4458 A flaw was found within the parsing of extended attributes in the kernel ksmbd module. Also affects hyperv-daemons
- CVE-2023-52904 In the Linux kernel, the following vulnerability has been resolved: ALSA: usb-audio: Fix… Also affects hyperv-daemons
- CVE-2024-38381 In the Linux kernel, the following vulnerability has been resolved: nfc: nci: Fix… Also affects hyperv-daemons
- CVE-2023-6535 A flaw was found in the Linux kernel's NVMe driver. Also affects hyperv-daemons
- CVE-2023-6270 A flaw was found in the ATA over Ethernet (AoE) driver in the Linux kernel. Also affects hyperv-daemons