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.

In piperesizeresults of pipe.c, there is a possible UAF bug caused by a race condition. This could lead to local denial of service and local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.

— OSV

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

16 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
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
redhat/kernel<5.19
5.19
Linux Kernel
Google Android
android/:linux_kernel:>=:0<:2023-01-05
:2023-01-05
debian/linux<5.18.2-1
5.18.2-1
debian/linux<5.18.2-1
5.18.2-1
debian/linux<5.18.2-1
5.18.2-1
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

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 redhat/kernel to a version that resolves this vulnerability.

    Fixed in 5.19
  6. Upgrade

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

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1
  7. Upgrade

    Upgrade android/:linux_kernel: to a version that resolves this vulnerability.

    Fixed in :2023-01-05
  8. Upgrade

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

    Fixed in 5.18.2-1
  9. Upgrade

    Upgrade Linux kernel to a version that resolves this vulnerability.

    Patch 189b0ddc245139af81198d1a3637cac74f96e13a

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
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·06:15 PM
DescriptionSeverityAffected Software
Jan 1, 2023
Advisory Published
via OSV·12:00 AM
Jan 3, 2023
Data Sourced
via Android·12:00 AM
SeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

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