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 566351C07C8 for ; Fri, 31 Jan 2025 11:32:02 +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=1738323123; cv=none; b=WEwAIgvd4Mhds+boGQsJeihexBdgZgk/EO/STo6G8qauKxJ8dg8vzhIjKmy/Ydp4nXK5cFXxaRgCzmXHz1LAzC4qSAAPE4n13oiaUF+k6osYO/2aDdn3aPp8LN+PqXWlj8aQ/1jQGYWfQzt3F6mePV6aFL+eH+M3Yp2OwqKYaA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738323123; c=relaxed/simple; bh=lXxDcIZGkyko6bKhfDejDKcbvYAgOi6U4t9QchAgaPg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=k3AaZA99hPT34zR5LuJ9sGuFW1YenleRNqUMi9tXUUhsyDFRojRupoWdsvrLprxsBbmdA9DleeXcXkJL13k1ZFDlC7QlKlSLYc14lI1LLwfK45lmkgLB+9jFbDTA1LKtFIZSa5JBQW21xkcxYkW2KK4uOtEqinuNaMHqjheGprI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XUmvaWL8; 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="XUmvaWL8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CDC5C4CEE2; Fri, 31 Jan 2025 11:32:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1738323122; bh=lXxDcIZGkyko6bKhfDejDKcbvYAgOi6U4t9QchAgaPg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XUmvaWL88u7ub0AtsAbfmsCxFh9x8NXzwcKCxKz0Qu8LZruU5W3UmKAGe5ZIQxQJM szk4lb5YLxq54n6x+uoMoERt2Hqe1vD69Che+qr8ifF9hQASfubm7VHoZSMz/U76fD PxpIXlcmN2jzTuiPY2UE1MNzPL+h95e/eDMK2HKA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21673: smb: client: fix double free of TCP_Server_Info::hostname Date: Fri, 31 Jan 2025 12:31:05 +0100 Message-ID: <2025013100-CVE-2025-21673-4465@gregkh> X-Mailer: git-send-email 2.48.1 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=4139; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=lXxDcIZGkyko6bKhfDejDKcbvYAgOi6U4t9QchAgaPg=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlztpRceXDxsMavYzoVb//tPdsvajPz34lALb+6/FqZj OK3dncWd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEWnQYFhyLM+c68v2J3/9e oYZlN9NOlN+ZfIlhfozYQTfONIsCo8DFgUYxN25minalAAA= 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: smb: client: fix double free of TCP_Server_Info::hostname When shutting down the server in cifs_put_tcp_session(), cifsd thread might be reconnecting to multiple DFS targets before it realizes it should exit the loop, so @server->hostname can't be freed as long as cifsd thread isn't done. Otherwise the following can happen: RIP: 0010:__slab_free+0x223/0x3c0 Code: 5e 41 5f c3 cc cc cc cc 4c 89 de 4c 89 cf 44 89 44 24 08 4c 89 1c 24 e8 fb cf 8e 00 44 8b 44 24 08 4c 8b 1c 24 e9 5f fe ff ff <0f> 0b 41 f7 45 08 00 0d 21 00 0f 85 2d ff ff ff e9 1f ff ff ff 80 RSP: 0018:ffffb26180dbfd08 EFLAGS: 00010246 RAX: ffff8ea34728e510 RBX: ffff8ea34728e500 RCX: 0000000000800068 RDX: 0000000000800068 RSI: 0000000000000000 RDI: ffff8ea340042400 RBP: ffffe112041ca380 R08: 0000000000000001 R09: 0000000000000000 R10: 6170732e31303000 R11: 70726f632e786563 R12: ffff8ea34728e500 R13: ffff8ea340042400 R14: ffff8ea34728e500 R15: 0000000000800068 FS: 0000000000000000(0000) GS:ffff8ea66fd80000(0000) 000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffc25376080 CR3: 000000012a2ba001 CR4: PKRU: 55555554 Call Trace: ? show_trace_log_lvl+0x1c4/0x2df ? show_trace_log_lvl+0x1c4/0x2df ? __reconnect_target_unlocked+0x3e/0x160 [cifs] ? __die_body.cold+0x8/0xd ? die+0x2b/0x50 ? do_trap+0xce/0x120 ? __slab_free+0x223/0x3c0 ? do_error_trap+0x65/0x80 ? __slab_free+0x223/0x3c0 ? exc_invalid_op+0x4e/0x70 ? __slab_free+0x223/0x3c0 ? asm_exc_invalid_op+0x16/0x20 ? __slab_free+0x223/0x3c0 ? extract_hostname+0x5c/0xa0 [cifs] ? extract_hostname+0x5c/0xa0 [cifs] ? __kmalloc+0x4b/0x140 __reconnect_target_unlocked+0x3e/0x160 [cifs] reconnect_dfs_server+0x145/0x430 [cifs] cifs_handle_standard+0x1ad/0x1d0 [cifs] cifs_demultiplex_thread+0x592/0x730 [cifs] ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] kthread+0xdd/0x100 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x29/0x50 The Linux kernel CVE team has assigned CVE-2025-21673 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit 7be3248f313930ff3d3436d4e9ddbe9fccc1f541 and fixed in 6.6.74 with commit 1ea68070338518a1d31ce71e6abfe1b30001b27a Issue introduced in 5.16 with commit 7be3248f313930ff3d3436d4e9ddbe9fccc1f541 and fixed in 6.12.11 with commit a2be5f2ba34d0c6d5ef2624b24e3d852561fcd6a Issue introduced in 5.16 with commit 7be3248f313930ff3d3436d4e9ddbe9fccc1f541 and fixed in 6.13 with commit fa2f9906a7b333ba757a7dbae0713d8a5396186e Issue introduced in 5.14.19 with commit 49f933bb3016269dc50074eac5f6033d127644f1 Issue introduced in 5.15.3 with commit 1c35a216ef77db708178ca225d796271f2f60a7a 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-21673 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/client/connect.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/1ea68070338518a1d31ce71e6abfe1b30001b27a https://git.kernel.org/stable/c/a2be5f2ba34d0c6d5ef2624b24e3d852561fcd6a https://git.kernel.org/stable/c/fa2f9906a7b333ba757a7dbae0713d8a5396186e