Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 454FA3BED31 for ; Fri, 1 May 2026 13:56:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777643809; cv=none; b=X91/a1NOkPMbm8lTiEVfnAtVY+wYPz4hE4UwKnvPDTnX77UmrtaaOT5oJN4fDRMyJ48TPkO4lrzB4Pqz19LaqKI8SQ5MlQVnalQTkQeFqCzxy7k+cnGFunHSII8q+0N/CzDVFGV4Ze4uTpIz5kpXduqcXi5D7pR/1qxIyqz7HOE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777643809; c=relaxed/simple; bh=9/vr5sMd45rlbAO8UXM0JiRMuEEvcVflaTNgXCwd160=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ja97tJO8Ld2N/2M/9dNmaTF+6buyIMuN4XnC9/1vnPkrWKBayAPuccl+Kgzlc6aiy4D3MsZ8QYcfuErTxFvZvyq21BgXVZHS41vr5nmTNVDS47sz+HvJRJf5nNciFoGyG/jfLxL5EkolTeNNRZe+SOUKLTIwnviDQyZQCOAgy9Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Xd49OH4U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Xd49OH4U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D35ADC2BCB4; Fri, 1 May 2026 13:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777643809; bh=9/vr5sMd45rlbAO8UXM0JiRMuEEvcVflaTNgXCwd160=; h=From:To:Cc:Subject:Date:Reply-To:From; b=Xd49OH4UzOQA/V2mDoxaXWMoAncn9Yrbs+UWVygnFriObjS6l1WlfwtiDX98Mqzau 1Jt6+MENwbC5lFctg6ydruMViWA/tr1Bt/VjOBSarw421uuhz7v0CLtseukNms9R8+ TYMl5qVIQ9vn5ObjmaGQnWt+aV9dLuww7cFsyioo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31711: smb: server: fix active_num_conn leak on transport allocation failure Date: Fri, 1 May 2026 15:56:33 +0200 Message-ID: <2026050122-CVE-2026-31711-ad49@gregkh> X-Mailer: git-send-email 2.54.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4583; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=A2sAMsR4Yw+4VY4/L6rF3pDPtsDVhkSgDKnWMVjlEmA=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlfNrK9c5yycrnnF66y4+uOqm4pXya0XWH565ILbS9CF M9vlH27qCOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmsieNYa5oTkrQj0Vntrmk e76wOb7zSPnVBd4M8ww9bmcGKPx34Ll0M+tk9eStGlovlwIA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman 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. The Linux kernel CVE team has assigned CVE-2026-31711 to this issue. Affected and fixed versions =========================== Issue introduced in 6.2 with commit 0d0d4680db22eda1eea785c47bbf66a9b33a8b16 and fixed in 6.6.136 with commit 97f8d2648ef4871e4cd335e2d769cb40054a6772 Issue introduced in 6.2 with commit 0d0d4680db22eda1eea785c47bbf66a9b33a8b16 and fixed in 6.12.84 with commit 295a9fc6789d1011c36ded9f0f2907bb34fa0de4 Issue introduced in 6.2 with commit 0d0d4680db22eda1eea785c47bbf66a9b33a8b16 and fixed in 6.18.25 with commit 283027aa93380380a0994f35dde3ec95318f2654 Issue introduced in 6.2 with commit 0d0d4680db22eda1eea785c47bbf66a9b33a8b16 and fixed in 7.0.2 with commit fb48185bcd946d42de7017cf27f912f8ab26acf0 Issue introduced in 6.2 with commit 0d0d4680db22eda1eea785c47bbf66a9b33a8b16 and fixed in 7.1-rc1 with commit 6551300dc452ac16a855a83dbd1e74899542d3b3 Issue introduced in 5.15.91 with commit 4210c3555db4b38bade92331b153e583261f05f9 Issue introduced in 6.1.9 with commit d5d7847e57ac69fa99c18b363a34419bcdb5a281 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-31711 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/smb/server/transport_tcp.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/97f8d2648ef4871e4cd335e2d769cb40054a6772 https://git.kernel.org/stable/c/295a9fc6789d1011c36ded9f0f2907bb34fa0de4 https://git.kernel.org/stable/c/283027aa93380380a0994f35dde3ec95318f2654 https://git.kernel.org/stable/c/fb48185bcd946d42de7017cf27f912f8ab26acf0 https://git.kernel.org/stable/c/6551300dc452ac16a855a83dbd1e74899542d3b3