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 3811F1F180C for ; Wed, 16 Apr 2025 14:15:53 +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=1744812953; cv=none; b=Ecm47Rk7t1NhoeuSWh6DiZk7LMf65XOsqdx7nxLWQPbAvxFHuRM8AGiMotF2F5WqLrwCiQFIvSQnoznKnkShiMe8DHDL1AnwI4SKhuaiLecWqyHplaE8SrriKue4bvCrigcazm1oYQCzEuTQKHgfpSQJovSUHGzmN09GK+euxJc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744812953; c=relaxed/simple; bh=TY7f9oJsyERcV9G5US6REsNmAAQDeejPudlM3f5iFsg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kZ0H93eiYyzh80U2i9mvsIfpllaO1miqQqRzKAZ6kCfGDTLxUlCKIP7RPKwue8QwQO6GKNMEs0KTwWfbXjsZSH7XBi6vsBVu2AAmqvM+aVL7AUbCR9Uct19o8S5jsqmaqr2GmxfEyy3t2J9kRV27J8n1gspI8/4vOkfwTOfvgPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SKZHUKxE; 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="SKZHUKxE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7B21C4CEE2; Wed, 16 Apr 2025 14:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744812953; bh=TY7f9oJsyERcV9G5US6REsNmAAQDeejPudlM3f5iFsg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SKZHUKxEov6wsYRl2m+C809XkGwvPG20Pc4f+0iUHcuO807I/pOfiqw69KPljX9Bl YTDRKVAPtT/mYcGea04bWkJmeVg+FjY/qOCqwRqgk+xaw2BDi+hs5kVzm0zOTAd7Iz v6BxhHv+rJ0i6xj8sJTZexedd3wEfwkCHIrintWA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-22040: ksmbd: fix session use-after-free in multichannel connection Date: Wed, 16 Apr 2025 16:12:11 +0200 Message-ID: <2025041659-CVE-2025-22040-27ed@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2481; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=TY7f9oJsyERcV9G5US6REsNmAAQDeejPudlM3f5iFsg=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn/d60/YG/xZtbq2j9TXnz/7pR380Lm7zNzs9zEuhYtj rloYtcf0hHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATec/PME+32GWZ9TQfhoMM n4qX953Z/pV/z0mGBdPOFfK2PLXI9gz7WuJ5N99wQcpCEwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix session use-after-free in multichannel connection There is a race condition between session setup and ksmbd_sessions_deregister. The session can be freed before the connection is added to channel list of session. This patch check reference count of session before freeing it. The Linux kernel CVE team has assigned CVE-2025-22040 to this issue. Affected and fixed versions =========================== Fixed in 6.1.134 with commit 596407adb9af1ee75fe7c7529607783d31b66e7f Fixed in 6.6.87 with commit 3980770cb1470054e6400fd97668665975726737 Fixed in 6.12.23 with commit 9069939d762138e232a6f79e3e1462682ed6a17d Fixed in 6.13.11 with commit 94c281721d4ed2d972232414b91d98a6f5bdb16b Fixed in 6.14.2 with commit 7dfbd4c43eed91dd2548a95236908025707a8dfd Fixed in 6.15-rc1 with commit fa4cdb8cbca7d6cb6aa13e4d8d83d1103f6345db 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-2025-22040 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/auth.c fs/smb/server/mgmt/user_session.c fs/smb/server/smb2pdu.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/596407adb9af1ee75fe7c7529607783d31b66e7f https://git.kernel.org/stable/c/3980770cb1470054e6400fd97668665975726737 https://git.kernel.org/stable/c/9069939d762138e232a6f79e3e1462682ed6a17d https://git.kernel.org/stable/c/94c281721d4ed2d972232414b91d98a6f5bdb16b https://git.kernel.org/stable/c/7dfbd4c43eed91dd2548a95236908025707a8dfd https://git.kernel.org/stable/c/fa4cdb8cbca7d6cb6aa13e4d8d83d1103f6345db