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 893B0194AD7 for ; Sat, 6 Dec 2025 21:52:23 +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=1765057943; cv=none; b=rr5N//p4k53evXE29gT4jdyq2Z07UZPTBSueF+ElYTUM5L6cnf2DvgIGg5MwjxivREK/nTxrTxNsNnXDMiG19HwmjPVUD6mfU2RhMkDcCnD/fzYdtxNl2QaDjXwsGLAMmIGPQTKsLj3GoLiF6Lr066fklYx3M4p4P/UWmLCIFxU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765057943; c=relaxed/simple; bh=AmGFWaa4BI5EqTB7w9mB8J+kGiKYhhy6fZiP245z3eM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=EPcD+qich9C/63ZsF92lesfT15KKWsFd1JhUHiSZrVnOlza89RSua+Rwd/rUPHmV8vwU9yLe0aj3iZqKnx5jUOgE/0bGjv6i4HdHJxgF2hIUzIufepcfz60+6uXtr0cU0Aj+HbJaIujwio5ZYTBbWArz8OVUJKPw/NSLiqW+Qbw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MLZbtXCY; 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="MLZbtXCY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFB0BC4CEF5; Sat, 6 Dec 2025 21:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765057943; bh=AmGFWaa4BI5EqTB7w9mB8J+kGiKYhhy6fZiP245z3eM=; h=From:To:Cc:Subject:Date:Reply-To:From; b=MLZbtXCYc3PKOas0DocKvVLH3d7AsJuj19wI8YFbBC1afQGZW5aHP+dmgK5E4kWE3 c+SK8fDplDzKfSkKwfjX/G3GdGU+rJ95bc/O5/Pejsv397ObjZt+kdyprnm72gwSUE CEGNJgCNXOQ8xdBUrOQKxAeZeUg7pREiJfwLrC1s= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40268: cifs: client: fix memory leak in smb3_fs_context_parse_param Date: Sun, 7 Dec 2025 06:52:15 +0900 Message-ID: <2025120715-CVE-2025-40268-390a@gregkh> X-Mailer: git-send-email 2.52.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=2710; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=HG4JLjsXN9HI/eVqYwy8pEiA2TKZnNrXiwdMUUuYzII=; b=owGbwMvMwCRo6H6F97bub03G02pJDJkmS/uzjTjZC7P4pZXji9ku3mNep9eQ0NSxxrXbYcN5n dDilpSOWBYGQSYGWTFFli/beI7urzik6GVoexpmDisTyBAGLk4BmIjsQYb5aendGStixQ+uPXmC 6faUo76FGkJWDAtaSy6W8HQKpq8UL7hZtjqwoOGEsTMA 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: client: fix memory leak in smb3_fs_context_parse_param The user calls fsconfig twice, but when the program exits, free() only frees ctx->source for the second fsconfig, not the first. Regarding fc->source, there is no code in the fs context related to its memory reclamation. To fix this memory leak, release the source memory corresponding to ctx or fc before each parsing. syzbot reported: BUG: memory leak unreferenced object 0xffff888128afa360 (size 96): backtrace (crc 79c9c7ba): kstrdup+0x3c/0x80 mm/util.c:84 smb3_fs_context_parse_param+0x229b/0x36c0 fs/smb/client/fs_context.c:1444 BUG: memory leak unreferenced object 0xffff888112c7d900 (size 96): backtrace (crc 79c9c7ba): smb3_fs_context_fullpath+0x70/0x1b0 fs/smb/client/fs_context.c:629 smb3_fs_context_parse_param+0x2266/0x36c0 fs/smb/client/fs_context.c:1438 The Linux kernel CVE team has assigned CVE-2025-40268 to this issue. Affected and fixed versions =========================== Fixed in 6.6.117 with commit 868fc62811d3fabcf5685e14f36377a855d5412d Fixed in 6.12.59 with commit 48c17341577e25a22feb13d694374b61d974edbc Fixed in 6.17.9 with commit 4515743cc7a42e1d67468402a6420c195532a6fa Fixed in 6.18 with commit e8c73eb7db0a498cd4b22d2819e6ab1a6f506bd6 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-40268 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/fs_context.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/868fc62811d3fabcf5685e14f36377a855d5412d https://git.kernel.org/stable/c/48c17341577e25a22feb13d694374b61d974edbc https://git.kernel.org/stable/c/4515743cc7a42e1d67468402a6420c195532a6fa https://git.kernel.org/stable/c/e8c73eb7db0a498cd4b22d2819e6ab1a6f506bd6