VYPR
High severity7.5NVD Advisory· Published May 1, 2026· Updated May 6, 2026

CVE-2026-31711

CVE-2026-31711

Description

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

smb: server: fix active_num_conn leak on transport allocation failure

Commit 77ffbcac4e56 ("smb: server: fix leak of active_num_conn in ksmbd_tcp_new_connection()") addressed the kthread_run() failure path. The earlier alloc_transport() == NULL path in the same function has the same leak, is reachable pre-authentication via any TCP connect to port 445, and was empirically reproduced on UML (ARCH=um, v7.0-rc7): a small number of forced allocation failures were sufficient to put ksmbd into a state where every subsequent connection attempt was rejected for the remainder of the boot.

ksmbd_kthread_fn() increments active_num_conn before calling ksmbd_tcp_new_connection() and discards the return value, so when alloc_transport() returns NULL the socket is released and -ENOMEM returned without decrementing the counter. Each such failure permanently consumes one slot from the max_connections pool; once cumulative failures reach the cap, atomic_inc_return() hits the threshold on every subsequent accept and every new connection is rejected. The counter is only reset by module reload.

An unauthenticated remote attacker can drive the server toward the memory pressure that makes alloc_transport() fail by holding open connections with large RFC1002 lengths up to MAX_STREAM_PROT_LEN (0x00FFFFFF); natural transient allocation failures on a loaded host produce the same drift more slowly.

Mirror the existing rollback pattern in ksmbd_kthread_fn(): on the alloc_transport() failure path, decrement active_num_conn gated on server_conf.max_connections.

Repro details: with the patch reverted, forced alloc_transport() NULL returns leaked counter slots and subsequent connection attempts -- including legitimate connects issued after the forced-fail window had closed -- were all rejected with "Limit the maximum number of connections". With this patch applied, the same connect sequence produces no rejections and the counter cycles cleanly between zero and one on every accept.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A leak of the active_num_conn counter in ksmbd's TCP connection handling allows an unauthenticated remote attacker to exhaust the max_connections pool, causing denial of service.

Vulnerability

Analysis

The vulnerability is a reference-count leak in the Linux kernel's ksmbd SMB server. When a new TCP connection is accepted, ksmbd_kthread_fn() increments the active_num_conn counter before calling ksmbd_tcp_new_connection(). If alloc_transport() returns NULL (e.g., due to memory pressure), the function returns -ENOMEM without decrementing the counter, permanently consuming one slot from the max_connections pool [1]. This leak was previously fixed for the kthread_run() failure path but was missed for the alloc_transport() failure path [1].

Exploitation

An unauthenticated remote attacker can trigger this leak by connecting to port 445 and causing alloc_transport() to fail. The attacker can drive the server toward memory pressure by holding open connections with large RFC1002 lengths up to MAX_STREAM_PROT_LEN (0x00FFFFFF) [1]. Natural transient allocation failures on a loaded host also produce the same drift, but more slowly. Each failure permanently consumes a connection slot; once cumulative failures reach the max_connections cap, every subsequent connection attempt is rejected with "Limit the maximum number of connections" [1].

Impact

The impact is a denial-of-service condition where the ksmbd server becomes unable to accept any new connections for the remainder of the boot cycle. The counter is only reset by module reload, so the server remains unusable until reboot or module removal [1]. This is reachable pre-authentication, requiring only TCP connectivity to port 445.

Mitigation

The fix mirrors the existing rollback pattern: on the alloc_transport() failure path, decrement active_num_conn gated on server_conf.max_connections [1]. The patch has been applied to multiple stable kernel branches [2][3][4]. Users should update to the latest stable kernel containing the fix.

AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

6
  • Linux/Kernelinferred6 versions
    (expand)+ 5 more
    • (no CPE)
    • cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*range: >=5.15.91,<5.16
    • cpe:2.3:o:linux:linux_kernel:6.2:-:*:*:*:*:*:*
    • cpe:2.3:o:linux:linux_kernel:6.2:rc6:*:*:*:*:*:*
    • cpe:2.3:o:linux:linux_kernel:6.2:rc7:*:*:*:*:*:*
    • cpe:2.3:o:linux:linux_kernel:6.2:rc8:*:*:*:*:*:*

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

News mentions

1