CVE-2022-2959: Linux Kernel Watch Queue Race Condition Privilege Escalation Vulnerability

Published May 27, 2022
·
Updated

A race condition was found in the Linux kernel's watch queue due to a missing lock in piperesizering(). The race condition may happen when thread (A) uses ioctl(IOCWATCHQUEUESETSIZE) to resize the pipe buffer and free the old pipe buffer, while another thread (B) uses keyctl() to trigger a notification in the watch queue, calling postonenotification() and accessing the freed pipe buffer.

ZDI advisory: https://www.zerodayinitiative.com/advisories/ZDI-22-1165/

Upstream fix: https://github.com/torvalds/linux/commit/189b0ddc245139af81198d1a3637cac74f96e13a

Other sources

A race condition was found in the Linux kernel's watch queue due to a missing lock in piperesizering(). The specific flaw exists within the handling of pipe buffers. The issue results from the lack of proper locking when performing operations on an object. This flaw allows a local user to crash the system or escalate their privileges on the system.

A race condition was found in the Linux kernel's watch queue due to a missing lock in the piperesizering(). The race condition occurs when a thread uses ioctl(IOCWATCHQUEUESETSIZE) to resize the pipe buffer and free the old pipe buffer, while another thread uses keyctl() to trigger a notification in the watch queue, calling postonenotification() and accessing the freed pipe buffer. This flaw allows a local user to crash the system or escalate their privileges on the system.

This vulnerability allows local attackers to escalate privileges on affected installations of Linux Kernel. An attacker must first obtain the ability to execute low-privileged code on the target system in order to exploit this vulnerability. The specific flaw exists within the handling of pipe buffers. The issue results from the lack of proper locking when performing operations on an object. An attacker can leverage this vulnerability to escalate privileges and execute arbitrary code in the context of the kernel.

ZDI

Affected Software

12 affected componentsFixes available
redhat/kernel<0:5.14.0-162.12.1.el9_1
0:5.14.0-162.12.1.el9_1
redhat/kernel-rt<0:5.14.0-162.12.1.rt21.175.el9_1
0:5.14.0-162.12.1.rt21.175.el9_1
redhat/kernel<0:5.14.0-70.36.1.el9_0
0:5.14.0-70.36.1.el9_0
redhat/kernel-rt<0:5.14.0-70.36.1.rt21.108.el9_0
0:5.14.0-70.36.1.rt21.108.el9_0
Google Android
Linux Kernel
Linux Linux kernel>=5.8<5.10.120
Linux Linux kernel>=5.11<5.15.45
Linux Linux kernel>=5.16<5.17.13
Linux Linux kernel>=5.18<5.18.2
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
redhat/kernel<5.19
5.19

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 0:5.14.0-162.12.1.el9_1
  2. Upgrade

    Upgrade redhat/kernel-rt to a version that resolves this vulnerability.

    Fixed in 0:5.14.0-162.12.1.rt21.175.el9_1
  3. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 0:5.14.0-70.36.1.el9_0
  4. Upgrade

    Upgrade redhat/kernel-rt to a version that resolves this vulnerability.

    Fixed in 0:5.14.0-70.36.1.rt21.108.el9_0
  5. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1
  6. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 5.19

Event History

May 27, 2022
CVE Published
12:00 AM
Jul 4, 2022
Data Sourced
via Red Hat·01:43 PM
DescriptionSeverityAffected Software
Aug 24, 2022
Advisory Published
via ZDI·12:00 AM
Data Sourced
via ZDI·12:00 AM
DescriptionSeverityAffected Software
Aug 25, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionWeakness
Jan 12, 2024
Data Sourced
via Launchpad·12:08 AM
Description
Dec 1, 2024
Data Sourced
via Ubuntu·03:01 AM
RemedyDescriptionSeverityAffected Software
Feb 26, 2025
Advisory Published
via ZDI·03:45 PM

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2022-2959?

CVE-2022-2959 has a medium severity level due to its potential impact on system stability and security.

2

How do I fix CVE-2022-2959?

To fix CVE-2022-2959, update to a patched version of the Linux kernel or kernel-rt as specified in the remediation versions from your distribution.

3

What versions are affected by CVE-2022-2959?

CVE-2022-2959 affects various versions of the Linux kernel prior to the patched releases, including those between 5.8 and 5.17.

4

What is a race condition in relation to CVE-2022-2959?

A race condition in CVE-2022-2959 occurs due to concurrent access to the watch queue which can lead to a system crash or unreadable data.

5

Which Linux distributions are affected by CVE-2022-2959?

CVE-2022-2959 affects several Linux distributions including Red Hat, Debian, and others that utilize the vulnerable versions of the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203