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 2473F245005 for ; Wed, 18 Jun 2025 09:36:36 +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=1750239397; cv=none; b=MMecFPIZQt/zSdSCzj2ozdWdHXvPcSHoCeaajgTsOfjMxgC5wAL45c0yh0fFTDOptwIyLov39MgudIn53tulRz1bR2zd6Sm9MZ920kkec5uqCXylB3dwXnTQ6kzd3LfaYNlxRwJ9/A6eacP9ZxPEIMs6BUMR8d4jhvZg3R2sUG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750239397; c=relaxed/simple; bh=gRcVDdeZ9N/LacD7TMBO57zgfS/aInBDYDsUKc7RDhk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lhh69QfKoa8K35LLUwZ6Polp2KH89pUQ686iGfa5RSzXSH1n+b1oa+j3Z1LaoIX/Q1cQiIRr9NQ9Viad8TkMfgwus0L6kSjkHcFL3v/woGDksoYPtfYEE2PgmAwpQG8wGOEElU9heAkUUfiUr4GQ8yPQTb6e/6GMu7gKqK6iAsY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LJDYnm2c; 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="LJDYnm2c" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CFE2C4CEE7; Wed, 18 Jun 2025 09:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750239396; bh=gRcVDdeZ9N/LacD7TMBO57zgfS/aInBDYDsUKc7RDhk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=LJDYnm2cF5LAGsrPbIR5yHoL8fMjSdEQSYIANzcfOVH51bMKjyCPAqQGyPOhHequ6 7rFHHR8M5ImeYpQUY6HAueK8pNc31kjDK/FS4MLaRtA5/p+WseTGnyEFO557VWWxnb jwar4oHa6HnfIYdlwDRs8E/Rq5vh4lxzHsKT/xyQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38058: __legitimize_mnt(): check for MNT_SYNC_UMOUNT should be under mount_lock Date: Wed, 18 Jun 2025 11:33:53 +0200 Message-ID: <2025061834-CVE-2025-38058-fe06@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=2989; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=AE+8drov28hovj2lmXCq5pOMKVXf9OIekMV1yR7Es6Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlB7e+OmjZlJVX5tu1+kBvX86dmyZKKnaKX7ssJFUypu r9Q4jlnRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzktBHD/PTNAbJsJ94++n09 W15qjeCVr9PXHWOYK9SzZ8mC56tyHrOtmPLxtnlQ+kY+FQA= 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: __legitimize_mnt(): check for MNT_SYNC_UMOUNT should be under mount_lock ... or we risk stealing final mntput from sync umount - raising mnt_count after umount(2) has verified that victim is not busy, but before it has set MNT_SYNC_UMOUNT; in that case __legitimize_mnt() doesn't see that it's safe to quietly undo mnt_count increment and leaves dropping the reference to caller, where it'll be a full-blown mntput(). Check under mount_lock is needed; leaving the current one done before taking that makes no sense - it's nowhere near common enough to bother with. The Linux kernel CVE team has assigned CVE-2025-38058 to this issue. Affected and fixed versions =========================== Fixed in 5.4.294 with commit 628fb00195ce21a90cf9e4e3d105cd9e58f77b40 Fixed in 5.10.238 with commit b89eb56a378b7b2c1176787fc228d0a57172bdd5 Fixed in 5.15.185 with commit f6d45fd92f62845cbd1eb5128fd8f0ed7d0c5a42 Fixed in 6.1.141 with commit 9b0915e72b3cf52474dcee0b24a2f99d93e604a3 Fixed in 6.6.93 with commit d8ece4ced3b051e656c77180df2e69e19e24edc1 Fixed in 6.12.31 with commit 8cafd7266fa02e0863bacbf872fe635c0b9725eb Fixed in 6.14.9 with commit b55996939c71a3e1a38f3cdc6a8859797efc9083 Fixed in 6.15 with commit 250cf3693060a5f803c5f1ddc082bb06b16112a9 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-38058 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/namespace.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/628fb00195ce21a90cf9e4e3d105cd9e58f77b40 https://git.kernel.org/stable/c/b89eb56a378b7b2c1176787fc228d0a57172bdd5 https://git.kernel.org/stable/c/f6d45fd92f62845cbd1eb5128fd8f0ed7d0c5a42 https://git.kernel.org/stable/c/9b0915e72b3cf52474dcee0b24a2f99d93e604a3 https://git.kernel.org/stable/c/d8ece4ced3b051e656c77180df2e69e19e24edc1 https://git.kernel.org/stable/c/8cafd7266fa02e0863bacbf872fe635c0b9725eb https://git.kernel.org/stable/c/b55996939c71a3e1a38f3cdc6a8859797efc9083 https://git.kernel.org/stable/c/250cf3693060a5f803c5f1ddc082bb06b16112a9