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 8D296330D39 for ; Wed, 17 Sep 2025 14:57:14 +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=1758121035; cv=none; b=NnCv8CARBr/ypwvARqpEHSyT3wXJNtqxNDUImBtUvGHVhEp1KWB9Sxau+78qFw4ehPdtgXn0p1sqBteO/E/JNkbQ9B6vKXh8oqc8uTfQV+71FjKLTcLbOemiYjo4VM8hRkuUaYV9tLj9DqmMGep5AZT+1ViY4ejY19pnbr9vNgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758121035; c=relaxed/simple; bh=OxaJP3L+RRTz8+5eAIAMuBsy5nER+X3DSh8K0KA2Hpg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ab3eXFrktiluqnr0lpG2wif5B+XHyh98lHMWcw5zoRC8yrYLvmAxFHgF9TQK/rkS3yiAoaTzSsCl0AZ1BcG6M90b8c55jBUbJ+0tRfSEIsuad2GTie0Kgv2RgxA0wGmsc49cxaTEMp5Q3LnDWczO1OThagzzLpqxYH/4Azlbpsc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vw/dGYxt; 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="vw/dGYxt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8BE8C4CEE7; Wed, 17 Sep 2025 14:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758121034; bh=OxaJP3L+RRTz8+5eAIAMuBsy5nER+X3DSh8K0KA2Hpg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=vw/dGYxtdPONIK1aNgFUjpXA36NKGf38w6n6QTChDhh5F+kwZ//IVaQQ3Pdb/cLOM IGuEd+5Y5YK4uqjCSCr3gHiQI1DtPuhONexCAsZ110cNLAM0tbZF72TzZNe16WiGQl EJ6mDrpp93gill85Md+iYtHOjx0Bqj/uGVcL/VEg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50372: cifs: Fix memory leak when build ntlmssp negotiate blob failed Date: Wed, 17 Sep 2025 16:56:31 +0200 Message-ID: <2025091717-CVE-2022-50372-e3b5@gregkh> X-Mailer: git-send-email 2.51.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=3116; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Em5tj1suEeqyDSh1TrN5J+0zBAf0BH9vckru7H7tbec=; b=kA0DAAIRMUfUDdst+ykByyZiAGjKzBGg+PrbI9dWRf1F7+u83eXwmdrSuUpPPoyw3XkTV9A9e YhdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmjKzBEACgkQMUfUDdst+ykn0gCeJFV1 5LXb3PVuR/ZYvgYfbgOg0CYAnjlZnoBvQ9jdpYkAgjea/+Sl6fjv 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: cifs: Fix memory leak when build ntlmssp negotiate blob failed There is a memory leak when mount cifs: unreferenced object 0xffff888166059600 (size 448): comm "mount.cifs", pid 51391, jiffies 4295596373 (age 330.596s) hex dump (first 32 bytes): fe 53 4d 42 40 00 00 00 00 00 00 00 01 00 82 00 .SMB@........... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<0000000060609a61>] mempool_alloc+0xe1/0x260 [<00000000adfa6c63>] cifs_small_buf_get+0x24/0x60 [<00000000ebb404c7>] __smb2_plain_req_init+0x32/0x460 [<00000000bcf875b4>] SMB2_sess_alloc_buffer+0xa4/0x3f0 [<00000000753a2987>] SMB2_sess_auth_rawntlmssp_negotiate+0xf5/0x480 [<00000000f0c1f4f9>] SMB2_sess_setup+0x253/0x410 [<00000000a8b83303>] cifs_setup_session+0x18f/0x4c0 [<00000000854bd16d>] cifs_get_smb_ses+0xae7/0x13c0 [<000000006cbc43d9>] mount_get_conns+0x7a/0x730 [<000000005922d816>] cifs_mount+0x103/0xd10 [<00000000e33def3b>] cifs_smb3_do_mount+0x1dd/0xc90 [<0000000078034979>] smb3_get_tree+0x1d5/0x300 [<000000004371f980>] vfs_get_tree+0x41/0xf0 [<00000000b670d8a7>] path_mount+0x9b3/0xdd0 [<000000005e839a7d>] __x64_sys_mount+0x190/0x1d0 [<000000009404c3b9>] do_syscall_64+0x35/0x80 When build ntlmssp negotiate blob failed, the session setup request should be freed. The Linux kernel CVE team has assigned CVE-2022-50372 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit 49bd49f983b5026e4557d31c5d737d9657c4113e and fixed in 6.0.6 with commit fa5a70bdd5e565c8696fb04dfe18a4e8aff4695d Issue introduced in 5.16 with commit 49bd49f983b5026e4557d31c5d737d9657c4113e and fixed in 6.1 with commit 30b2d7f8f13664655480d6af45f60270b3eb6736 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-2022-50372 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/cifs/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/fa5a70bdd5e565c8696fb04dfe18a4e8aff4695d https://git.kernel.org/stable/c/30b2d7f8f13664655480d6af45f60270b3eb6736