Bug 2103681 (CVE-2022-2959)

Summary: CVE-2022-2959 kernel: watch queue race condition can lead to privilege escalation
Product: [Other] Security Response Reporter: Mauro Matteo Cascella <mcascell>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: acaringi, adscvr, airlied, alciregi, bhu, brdeoliv, bskeggs, chwhite, crwood, ctoe, dbohanno, ddepaula, debarbos, dhoward, dhowells, dvlasenk, hdegoede, hkrzesin, hpa, ikent, jarod, jarodwilson, jburrell, jfaracco, jferlan, jforbes, jglisse, jlelli, joe.lawrence, jonathan, josef, jpoimboe, jshortt, jstancek, jwboyer, jwyatt, kcarcia, kernel-maint, kernel-mgr, kpatch-maint, lgoncalv, linville, lleshchi, lzampier, masami256, mchehab, nmurray, ptalbert, qzhao, rhandlin, rvrbovsk, scweaver, security-response-team, steved, tyberry, vkumar, walters, williams, xzhou, ycote
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel 5.19 Doc Type: If docs needed, set a value
Doc Text:
A race condition was found in the Linux kernel's watch queue due to a missing lock in the pipe_resize_ring(). The race condition occurs when a thread uses ioctl(IOC_WATCH_QUEUE_SET_SIZE) 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 post_one_notification() and accessing the freed pipe buffer. This flaw allows a local user to crash the system or escalate their privileges on the system.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-25 08:22:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2115232, 2115233, 2141630, 2141631, 2141632, 2141633, 2141634, 2141635, 2141636, 2141637    
Bug Blocks: 2103682    

Description Mauro Matteo Cascella 2022-07-04 13:43:36 UTC
A race condition was found in the Linux kernel's watch queue due to a missing lock in pipe_resize_ring(). The race condition may happen when thread (A) uses ioctl(IOC_WATCH_QUEUE_SET_SIZE) 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 post_one_notification() 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

Comment 9 errata-xmlrpc 2022-12-13 16:05:50 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.0 Extended Update Support

Via RHSA-2022:8973 https://access.redhat.com/errata/RHSA-2022:8973

Comment 10 errata-xmlrpc 2022-12-13 16:06:28 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.0 Extended Update Support

Via RHSA-2022:8974 https://access.redhat.com/errata/RHSA-2022:8974

Comment 11 errata-xmlrpc 2022-12-15 16:24:30 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.0 Extended Update Support

Via RHSA-2022:9082 https://access.redhat.com/errata/RHSA-2022:9082

Comment 13 errata-xmlrpc 2023-01-23 15:16:55 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2023:0300 https://access.redhat.com/errata/RHSA-2023:0300

Comment 14 errata-xmlrpc 2023-01-23 15:21:27 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2023:0334 https://access.redhat.com/errata/RHSA-2023:0334

Comment 15 errata-xmlrpc 2023-01-23 15:23:05 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2023:0348 https://access.redhat.com/errata/RHSA-2023:0348

Comment 16 Product Security DevOps Team 2023-01-25 08:22:11 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2022-2959

Comment 17 Red Hat Bugzilla 2023-09-28 04:25:13 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days