Bug 2253034 (CVE-2023-6531) - CVE-2023-6531 kernel: GC's deletion of an SKB races with unix_stream_read_generic() leading to UAF
Summary: CVE-2023-6531 kernel: GC's deletion of an SKB races with unix_stream_read_gen...
Keywords:
Status: NEW
Alias: CVE-2023-6531
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 2253033
TreeView+ depends on / blocked
 
Reported: 2023-12-05 18:06 UTC by Rohit Keshri
Modified: 2024-05-02 22:50 UTC (History)
50 users (show)

Fixed In Version: Kernel 6.7-rc5
Doc Type: If docs needed, set a value
Doc Text:
A use-after-free flaw was found in the Linux Kernel due to a race problem in the unix garbage collector's deletion of SKB races with unix_stream_read_generic() on the socket that the SKB is queued on.
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2024:2634 0 None None None 2024-05-01 01:22:12 UTC
Red Hat Product Errata RHBA-2024:2650 0 None None None 2024-05-02 00:14:59 UTC
Red Hat Product Errata RHBA-2024:2686 0 None None None 2024-05-02 22:50:06 UTC
Red Hat Product Errata RHSA-2024:2394 0 None None None 2024-04-30 10:14:26 UTC

Description Rohit Keshri 2023-12-05 18:06:29 UTC
If the Unix GC's deletion of an SKB races with unix_stream_read_generic() on the socket that the SKB was queued up on, we get a race condition, leading to UAF, because it is supposed to be impossible to run these operations in parallel on the same socket:

 - unix_stream_read_generic() assumes that `mutex_lock(&u->iolock)` protects
   `sk->sk_receive_queue` against element removal, so it holds a pointer to an
   SKB on the `sk->sk_receive_queue` without any other protection
 - scan_inflight() only takes `spin_lock(&x->sk_receive_queue.lock)` when
   stealing SKBs from the `sk_receive_queue`

Comment 11 errata-xmlrpc 2024-04-30 10:14:23 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:2394 https://access.redhat.com/errata/RHSA-2024:2394


Note You need to log in before you can comment on or make changes to this bug.