bpf: Fix bpf_sk_select_reuseport() memory leak
As pointed out in the original comment, lookup in sockmap can return a TCP
ESTABLISHED socket. Such TCP socket may have had SO_ATTACH_REUSEPORT_EBPF
set before it was ESTABLISHED. In other words, a non-NULL sk_reuseport_cb
does not imply a non-refcounted socket.
Drop sk's reference in both error paths.
unreferenced object 0xffff888101911800 (size 2048):
comm "test_progs", pid 44109, jiffies 4297131437
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
80 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 9336483b):
__kmalloc_noprof+0x3bf/0x560
__reuseport_alloc+0x1d/0x40
reuseport_alloc+0xca/0x150
reuseport_attach_prog+0x87/0x140
sk_reuseport_attach_bpf+0xc8/0x100
sk_setsockopt+0x1181/0x1990
do_sock_setsockopt+0x12b/0x160
__sys_setsockopt+0x7b/0xc0
__x64_sys_setsockopt+0x1b/0x30
do_syscall_64+0x93/0x180
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Metrics
Affected Vendors & Products
| Source | ID | Title | 
|---|---|---|
  Debian DLA | 
                DLA-4075-1 | linux security update | 
  Debian DLA | 
                DLA-4076-1 | linux-6.1 security update | 
  EUVD | 
                EUVD-2025-2632 | In the Linux kernel, the following vulnerability has been resolved: bpf: Fix bpf_sk_select_reuseport() memory leak As pointed out in the original comment, lookup in sockmap can return a TCP ESTABLISHED socket. Such TCP socket may have had SO_ATTACH_REUSEPORT_EBPF set before it was ESTABLISHED. In other words, a non-NULL sk_reuseport_cb does not imply a non-refcounted socket. Drop sk's reference in both error paths. unreferenced object 0xffff888101911800 (size 2048): comm "test_progs", pid 44109, jiffies 4297131437 hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 80 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc 9336483b): __kmalloc_noprof+0x3bf/0x560 __reuseport_alloc+0x1d/0x40 reuseport_alloc+0xca/0x150 reuseport_attach_prog+0x87/0x140 sk_reuseport_attach_bpf+0xc8/0x100 sk_setsockopt+0x1181/0x1990 do_sock_setsockopt+0x12b/0x160 __sys_setsockopt+0x7b/0xc0 __x64_sys_setsockopt+0x1b/0x30 do_syscall_64+0x93/0x180 entry_SYSCALL_64_after_hwframe+0x76/0x7e | 
  Ubuntu USN | 
                USN-7387-1 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7387-2 | Linux kernel (FIPS) vulnerabilities | 
  Ubuntu USN | 
                USN-7387-3 | Linux kernel (Real-time) vulnerabilities | 
  Ubuntu USN | 
                USN-7388-1 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7389-1 | Linux kernel (NVIDIA Tegra) vulnerabilities | 
  Ubuntu USN | 
                USN-7390-1 | Linux kernel (Xilinx ZynqMP) vulnerabilities | 
  Ubuntu USN | 
                USN-7407-1 | Linux kernel (HWE) vulnerabilities | 
  Ubuntu USN | 
                USN-7421-1 | Linux kernel (Azure) vulnerabilities | 
  Ubuntu USN | 
                USN-7445-1 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7448-1 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7458-1 | Linux kernel (IBM) vulnerabilities | 
  Ubuntu USN | 
                USN-7459-1 | Linux kernel (Intel IoTG) vulnerabilities | 
  Ubuntu USN | 
                USN-7459-2 | Linux kernel (GCP) vulnerabilities | 
  Ubuntu USN | 
                USN-7595-1 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7595-2 | Linux kernel (Real-time) vulnerabilities | 
  Ubuntu USN | 
                USN-7595-3 | Linux kernel (Raspberry Pi Real-time) vulnerabilities | 
  Ubuntu USN | 
                USN-7595-4 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7595-5 | Linux kernel vulnerabilities | 
  Ubuntu USN | 
                USN-7596-1 | Linux kernel (Azure) vulnerabilities | 
  Ubuntu USN | 
                USN-7596-2 | Linux kernel (Azure, N-Series) vulnerabilities | 
  Ubuntu USN | 
                USN-7653-1 | Linux kernel (HWE) vulnerabilities | 
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
Mon, 03 Nov 2025 21:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References | 
         | 
Wed, 01 Oct 2025 20:15:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| Metrics | 
        
        ssvc
         
  | 
Wed, 16 Jul 2025 13:45:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| Metrics | 
        
        
        epss
         
  | 
    
        
        
        epss
         
  | 
Fri, 11 Jul 2025 13:45:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| Metrics | 
        
        
        epss
         
  | 
    
        
        
        epss
         
  | 
Mon, 03 Feb 2025 20:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| First Time appeared | 
        
        Linux
         Linux linux Kernel  | 
|
| Weaknesses | CWE-401 | |
| CPEs | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc3:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc4:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc5:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc6:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.13:rc7:*:*:*:*:*:*  | 
|
| Vendors & Products | 
        
        Linux
         Linux linux Kernel  | 
Sun, 02 Feb 2025 10:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References | 
         | 
Sat, 01 Feb 2025 02:00:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References | 
         | |
| Metrics | 
        
        
        threat_severity
         
  | 
    
        
        cvssV3_1
         
 
  | 
Fri, 31 Jan 2025 11:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| Description | In the Linux kernel, the following vulnerability has been resolved: bpf: Fix bpf_sk_select_reuseport() memory leak As pointed out in the original comment, lookup in sockmap can return a TCP ESTABLISHED socket. Such TCP socket may have had SO_ATTACH_REUSEPORT_EBPF set before it was ESTABLISHED. In other words, a non-NULL sk_reuseport_cb does not imply a non-refcounted socket. Drop sk's reference in both error paths. unreferenced object 0xffff888101911800 (size 2048): comm "test_progs", pid 44109, jiffies 4297131437 hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 80 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc 9336483b): __kmalloc_noprof+0x3bf/0x560 __reuseport_alloc+0x1d/0x40 reuseport_alloc+0xca/0x150 reuseport_attach_prog+0x87/0x140 sk_reuseport_attach_bpf+0xc8/0x100 sk_setsockopt+0x1181/0x1990 do_sock_setsockopt+0x12b/0x160 __sys_setsockopt+0x7b/0xc0 __x64_sys_setsockopt+0x1b/0x30 do_syscall_64+0x93/0x180 entry_SYSCALL_64_after_hwframe+0x76/0x7e | |
| Title | bpf: Fix bpf_sk_select_reuseport() memory leak | |
| References | 
         | 
        
  | 
Status: PUBLISHED
Assigner: Linux
Published:
Updated: 2025-11-03T20:59:02.244Z
Reserved: 2024-12-29T08:45:45.739Z
Link: CVE-2025-21683
Updated: 2025-10-01T15:59:19.313Z
Status : Modified
Published: 2025-01-31T12:15:29.460
Modified: 2025-11-03T21:19:06.580
Link: CVE-2025-21683
                        OpenCVE Enrichment
                    No data.
 Debian DLA
 EUVD
 Ubuntu USN