Skip to content
Fencer Vulns
high 8.1

CVE-2023-52885 json

SUNRPC: Fix UAF in svc_tcp_listen_data_ready()

published 2024-07-14 2 y ago modified 2026-08-05 3 mo ago also EUVD-2023-59598

cvss
8.1
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.6%
EPSS 0.6% chance of exploitation in 30 days, percentile 46%
public exploits
0
none known

Summary

In the Linux kernel, the following vulnerability has been resolved:

SUNRPC: Fix UAF in svc_tcp_listen_data_ready()

After the listener svc_sock is freed, and before invoking svc_tcp_accept() for the established child sock, there is a window that the newsock retaining a freed listener svc_sock in sk_user_data which cloning from parent. In the race window, if data is received on the newsock, we will observe use-after-free report in svc_tcp_listen_data_ready().

Reproduce by two tasks:

1. while :; do rpc.nfsd 0 ; rpc.nfsd; done 2. while :; do echo "" | ncat -4 127.0.0.1 2049 ; done

KASAN report:

================================================================== BUG: KASAN: slab-use-after-free in svc_tcp_listen_data_ready+0x1cf/0x1f0 [sunrpc] Read of size 8 at addr ffff888139d96228 by task nc/102553 CPU: 7 PID: 102553 Comm: nc Not tainted 6.3.0+ #18 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 Call Trace: <IRQ> dump_stack_lvl+0x33/0x50 print_address_description.constprop.0+0x27/0x310 print_report+0x3e/0x70 kasan_report+0xae/0xe0 svc_tcp_listen_data_ready+0x1cf/0x1f0 [sunrpc] tcp_data_queue+0x9f4/0x20e0 tcp_rcv_established+0x666/0x1f60 tcp_v4_do_rcv+0x51c/0x850 tcp_v4_rcv+0x23fc/0x2e80 ip_protocol_deliver_rcu+0x62/0x300 ip_local_deliver_finish+0x267/0x350 ip_local_deliver+0x18b/0x2d0 ip_rcv+0x2fb/0x370 __netif_receive_skb_one_core+0x166/0x1b0 process_backlog+0x24c/0x5e0 __napi_poll+0xa2/0x500 net_rx_action+0x854/0xc90 __do_softirq+0x1bb/0x5de do_softirq+0xcb/0x100 </IRQ> <TASK> ... </TASK>

Allocated by task 102371: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 __kasan_kmalloc+0x7b/0x90 svc_setup_socket+0x52/0x4f0 [sunrpc] svc_addsock+0x20d/0x400 [sunrpc] __write_ports_addfd+0x209/0x390 [nfsd] write_ports+0x239/0x2c0 [nfsd] nfsctl_transaction_write+0xac/0x110 [nfsd] vfs_write+0x1c3/0xae0 ksys_write+0xed/0x1c0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc

Freed by task 102551: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_save_free_info+0x2a/0x50 __kasan_slab_free+0x106/0x190 __kmem_cache_free+0x133/0x270 svc_xprt_free+0x1e2/0x350 [sunrpc] svc_xprt_destroy_all+0x25a/0x440 [sunrpc] nfsd_put+0x125/0x240 [nfsd] nfsd_svc+0x2cb/0x3c0 [nfsd] write_threads+0x1ac/0x2a0 [nfsd] nfsctl_transaction_write+0xac/0x110 [nfsd] vfs_write+0x1c3/0xae0 ksys_write+0xed/0x1c0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc

Fix the UAF by simply doing nothing in svc_tcp_listen_data_ready() if state != TCP_LISTEN, that will avoid dereferencing svsk for all child socket.

Patch / fix

  • Linux Linux 4.14.322, 4.19.291, 5.4.251, 5.10.188, 5.15.121, 6.1.39, 6.4.4, 6.5
  • linux Debian 12 6.1.52-1
  • linux Debian 14, Debian 13 6.4.4-1

debian advisories DEBIAN-CVE-2023-52885

  • linux Ubuntu 20.04 LTS 5.4.0-166.183
  • linux Ubuntu 22.04 LTS 5.15.0-86.96
  • linux-aws Ubuntu 20.04 LTS 5.4.0-1113.123
  • linux-aws Ubuntu 22.04 LTS 5.15.0-1047.52
  • linux-gcp Ubuntu 20.04 LTS 5.4.0-1117.126
  • linux-gcp Ubuntu 22.04 LTS 5.15.0-1044.52
  • linux-gke Ubuntu 22.04 LTS 5.15.0-1044.49
  • linux-ibm Ubuntu 20.04 LTS 5.4.0-1060.65

ubuntu advisories UBUNTU-CVE-2023-52885

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • kernel RHEL 8.6 TUS, RHEL 8.6 E4S, RHEL 8.6 AUS 4.18.0-372.118.1.el8_6
  • perf RHEL 8.6 TUS, RHEL 8.6 E4S, RHEL 8.6 AUS 4.18.0-372.118.1.el8_6
  • bpftool RHEL 8.6 TUS, RHEL 8.6 E4S, RHEL 8.6 AUS 4.18.0-372.118.1.el8_6
  • kernel-core RHEL 8.6 TUS, RHEL 8.6 E4S, RHEL 8.6 AUS 4.18.0-372.118.1.el8_6
  • kernel-tools RHEL 8.6 TUS, RHEL 8.6 E4S, RHEL 8.6 AUS 4.18.0-372.118.1.el8_6
  • python3-perf RHEL 8.6 TUS, RHEL 8.6 E4S, RHEL 8.6 AUS 4.18.0-372.118.1.el8_6
  • kernel-modules RHEL 8.6 TUS, RHEL 8.6 E4S, RHEL 8.6 AUS 4.18.0-372.118.1.el8_6
  • kernel-zfcpdump RHEL 8.6 E4S 4.18.0-372.118.1.el8_6

red hat advisories RHSA-2024:5281RHSA-2024:5066RHSA-2024:5067

  • kernel-rt Linux Micro 6.0 6.4.0-10.1
  • kernel-source-rt Linux Micro 6.0 6.4.0-10.1
  • kernel-livepatch-MICRO-6-0-RT_Update_2 Linux Micro 6.0 1-1.1
  • kernel-source Linux Micro 6.0 6.4.0-19.1
  • kernel-default Linux Micro 6.0 6.4.0-19.1
  • kernel-kvmsmall Linux Micro 6.0 6.4.0-19.1
  • kernel-default-base Linux Micro 6.0 6.4.0-17.1.1.51
  • kernel-livepatch-MICRO-6-0_Update_2 Linux Micro 6.0 1-1.1

suse advisories SUSE-SU-2025:1448-1SUSE-SU-2025:1423-1SUSE-SU-2025:1422-1SUSE-SU-2025:20047-1SUSE-SU-2025:20044-1SUSE-SU-2024:3383-1

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2023-52885 updated cvss 5.5

kernel: SUNRPC: Fix UAF in svc_tcp_listen_data_ready()

  • Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more
    affected: workaround, no fix planned “Out of support scope”
  • Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 more
    affected: workaround, no fix available
  • Red Hat CodeReady Linux Builder EUS (v.9.2) kernel-debuginfo-common-s390x 5.14.0-284.77.1.el9_2, kernel-debuginfo-common-x86_64 5.14.0-284.77.1.el9_2, kernel-debuginfo-common-aarch64 5.14.0-284.77.1.el9_2, kernel-debuginfo-common-ppc64le 5.14.0-284.77.1.el9_2 Red Hat Enterprise Linux AppStream EUS (v.9.2) perf 5.14.0-284.77.1.el9_2, rtla 5.14.0-284.77.1.el9_2, kernel-devel-matched 5.14.0-284.77.1.el9_2, kernel-64k-devel-matched 5.14.0-284.77.1.el9_2, kernel-debug-devel-matched 5.14.0-284.77.1.el9_2, kernel-debuginfo-common-s390x 5.14.0-284.77.1.el9_2, +5 more
    fixed: vendor fix RHSA-2024:5066
  • Red Hat Enterprise Linux BaseOS AUS (v.8.6) perf 4.18.0-372.118.1.el8_6, kernel 4.18.0-372.118.1.el8_6, bpftool 4.18.0-372.118.1.el8_6, kernel-core 4.18.0-372.118.1.el8_6, kernel-tools 4.18.0-372.118.1.el8_6, python3-perf 4.18.0-372.118.1.el8_6, +8 more Red Hat Enterprise Linux BaseOS E4S (v.8.6) perf 4.18.0-372.118.1.el8_6, kernel 4.18.0-372.118.1.el8_6, bpftool 4.18.0-372.118.1.el8_6, kernel-core 4.18.0-372.118.1.el8_6, kernel-tools 4.18.0-372.118.1.el8_6, python3-perf 4.18.0-372.118.1.el8_6, +15 more
    fixed: vendor fix RHSA-2024:5281
  • Red Hat Enterprise Linux BaseOS EUS (v.9.2) bpftool 7.0.0-284.77.1.el9_2, kernel 5.14.0-284.77.1.el9_2, kernel-64k 5.14.0-284.77.1.el9_2, kernel-core 5.14.0-284.77.1.el9_2, kernel-tools 5.14.0-284.77.1.el9_2, python3-perf 5.14.0-284.77.1.el9_2, +28 more
    fixed: vendor fix RHSA-2024:5066
  • Red Hat Enterprise Linux BaseOS TUS (v.8.6) perf 4.18.0-372.118.1.el8_6, kernel 4.18.0-372.118.1.el8_6, bpftool 4.18.0-372.118.1.el8_6, kernel-core 4.18.0-372.118.1.el8_6, kernel-tools 4.18.0-372.118.1.el8_6, python3-perf 4.18.0-372.118.1.el8_6, +8 more
    fixed: vendor fix RHSA-2024:5281
  • Red Hat Enterprise Linux Real Time EUS (v.9.2) kernel-rt 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-core 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-modules 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-debug-core 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-modules-core 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-debug-modules 5.14.0-284.77.1.rt14.362.el9_2, +4 more Red Hat Enterprise Linux Real Time for NFV EUS (v.9.2) kernel-rt 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-kvm 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-core 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-modules 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-debug-kvm 5.14.0-284.77.1.rt14.362.el9_2, kernel-rt-debug-core 5.14.0-284.77.1.rt14.362.el9_2, +6 more
    fixed: vendor fix RHSA-2024:5067
  • Red Hat Enterprise Linux AppStream EUS (v.9.2) kernel-doc 5.14.0-284.77.1.el9_2 Red Hat Enterprise Linux BaseOS AUS (v.8.6) kernel-headers 4.18.0-372.118.1.el8_6, kernel-cross-headers 4.18.0-372.118.1.el8_6 Red Hat Enterprise Linux BaseOS E4S (v.8.6) kernel-headers 4.18.0-372.118.1.el8_6, kernel-cross-headers 4.18.0-372.118.1.el8_6 Red Hat Enterprise Linux BaseOS TUS (v.8.6) kernel-headers 4.18.0-372.118.1.el8_6, kernel-cross-headers 4.18.0-372.118.1.el8_6
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
partial
Assessed
2 y ago

Exploit prediction

0.56% chance of exploitation in the next 30 days, higher than 46% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected products

  • Linux Linux

Classification

Weakness
Technology feeds

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.