Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792758849; b=BoIhkCBSYBTigbQKcTrnivqWnO4kiPTGIoZ42pdky82qZNb97Zwe1vLG9EcumOkwy62Q yNJtNAKfBqhmnZ/+jED0Qq0mBaUH2fQxYjK3r3a88oags2whvZuVMjj0QlVVfMGDyx1Sz CoIaA9GsvpKBb0h+7JRYYxOCt/KYAl7N/Bgcq+aPAE+s2/2jGvVn1b2dZQLzDz6ojMoBu y2qgiDTrz7kOOqn03IqpZTgRk52w6cs06p+mW5lE935/dFaH8LSxRO36h5PjB3BLsE9Rf GX5kSFgQgEfX4g8Y3i8RgdGSBN5Vm1xQhg87aepUNymAqYOeEIcwCCxvcQz+YYGKgfg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792758849; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=wdLcdFjorskeg6hsBsHY3haF3XofLEJprWIsIFmGosI=; b=phG4q4R3zrkvF9L4rZA/RJnYFKMfkofM4iH4vkgixI6JOVEpyZa+nuBFk4u2qzoiVoSw 6b6XtKd+kl1+FYi6fswL5KV6hBEPMz5zjoVJs955pS950ChjcEIyLKLOUqJDh+fSknRFA 3rDsNb2gUlFEZ3OHlNNKqrTAOhTd1wp0bSYyJkyN8lTEnIMKYwBei3qtqt/9iS+OsF93N ozTSZwLPLp1hYL2Y/dY7U+1talvIvuksHBn0EktAAk4sRKahBh8065OZg7YL29jZxFBW9 d0+bDcJ18l0JOrypQtsk7JWuNdWgOzyyPC69YYIhgL3F7iv3aKXXyF2pNfl1IU1v4LQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Eay+mMwA; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10433606A31B for ; Fri, 23 Oct 2026 12:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Eay+mMwA Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EA841F031E0; Fri, 23 Oct 2026 12:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792758848; bh=wdLcdFjorskeg6hsBsHY3haF3XofLEJprWIsIFmGosI=; h=From:To:Cc:Subject:Date:Reply-To; b=Eay+mMwAoJerfLVRFLUKrDFWlLaQBduhYdf0sgSUKRopMAGVUo49BWMd+xTaLxe2t 2bMh3J266VNfNDjypASXS5qIjzzfOnkw/nrUw/GkGtTemrkdWEx/luEgg7CpBXKJnX cDQJvEfWPM3uJc+I3MupK/IGnNZI2IqLjnDOBw2E= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98977: namespace: handle mount locking for automounts correctly Date: Fri, 23 Oct 2026 14:19:39 +0200 Message-ID: <2026102312-CVE-2026-98977-0bc1@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4411; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Fw6iof7ZpZFfxWTmgYZFdc4x2Wif0DABgvzd/KOijtc=; b=owGbwMvMwCRo6H6F97bub03G02pJDFm3Aw583/XCT6Ci6dGM+lmeKy63Ku2L7JY44FD5vnFqS R2zL2thRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExEi4thwQ2OJufjqzg1lwh/ P+n3y0jx1Wrz9Qzz9P6VXOZJ/+F1ODfj7fdvmyf991jQCQA= 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: namespace: handle mount locking for automounts correctly If mounts are propagated across user namespaces, attach_recursive_mnt() locks every copy of the source mount to protect overmounts from vanishing and revealing the underlying files or directories. The user namespace is taken from the caller's mount namespaces since this is where the mounts end up. Except, that's not always true. Automounts may legitimately get popped in by tasks located in a different mount and user namespace during path lookup. Then check doesn't make sense at that point. The copy in the namespace of the parent - which may be the host's - is now locked and the host cannot change the flags of its own mounts anymore. Here's the reproducer: - host has debugfs mounted nosuid,nodev,noexec and shared - tracefs automount below it is not yet active - hand a child process a directory descriptor on that mount - child process enters auser and mount namespace - child process' namespace now holds a locked copy of the host's debugfs mount that receives propagation from it - child process stats "tracing/." through the descriptor - lookup runs on the host's mount so the automount lands below the host's mount - propagation puts a copy below the child's copy - both try to clear the flags on the mount they got, with a bind remount: host, on its own automount: MS_REMOUNT|MS_BIND = EPERM child, on the copy in its namespace: MS_REMOUNT|MS_BIND = 0 So the lock landed on the host's mount instead of the child's copy. Congrats. So we need to compare with the owner of the namespace the mount actually gets mounted on. For all regular cases that is the caller's mount namespace and so nothing changes. Detached trees in anonymous mount namespaces by be handed over via SCM_RIGHTS or inherited in other ways on purpose so the attaching task's mount namespace is authoritative, not the creator of the detached tree. The Linux kernel CVE team has assigned CVE-2026-98977 to this issue. Affected and fixed versions =========================== Issue introduced in 3.9 with commit 132c94e31b8bca8ea921f9f96a57d684fa4ae0a9 and fixed in 6.6.160 with commit 5e8f3ac8fa3d411b422ad32b9168c46a4824cc79 Issue introduced in 3.9 with commit 132c94e31b8bca8ea921f9f96a57d684fa4ae0a9 and fixed in 6.12.114 with commit b3ccde78f1608836e62320428abc0e8aa9cf2329 Issue introduced in 3.9 with commit 132c94e31b8bca8ea921f9f96a57d684fa4ae0a9 and fixed in 6.18.57 with commit e01c79761c7b3373e80094c5eadb21cb864fa8bc Issue introduced in 3.9 with commit 132c94e31b8bca8ea921f9f96a57d684fa4ae0a9 and fixed in 7.2.11 with commit 6ab37fae14196ba2262b152a7d9222c50356d278 Issue introduced in 3.9 with commit 132c94e31b8bca8ea921f9f96a57d684fa4ae0a9 and fixed in 7.3 with commit 33aadc7c72055fca93cb5a3691d836ebf8b31c9b Issue introduced in 3.8.6 with commit 9c773201d61272db49f8f33a83a3cb2a3fe4b14f 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-2026-98977 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/5e8f3ac8fa3d411b422ad32b9168c46a4824cc79 https://git.kernel.org/stable/c/b3ccde78f1608836e62320428abc0e8aa9cf2329 https://git.kernel.org/stable/c/e01c79761c7b3373e80094c5eadb21cb864fa8bc https://git.kernel.org/stable/c/6ab37fae14196ba2262b152a7d9222c50356d278 https://git.kernel.org/stable/c/33aadc7c72055fca93cb5a3691d836ebf8b31c9b