From mboxrd@z Thu Jan 1 00:00:00 1970 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 EDC5DF516 for ; Wed, 17 Apr 2024 09:44:39 +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=1713347080; cv=none; b=f0zcvDstwlrPHhfw+1QH8Z/mQOAO4sSjjDm3QUnxKLXkOUKGCmqVy1Mr/Tty6/RH+AkbH2HySSJ7MjUPi4NGOLqTucqGm7mnkDS7B1fO+ZwMvVGKBz96JT2Y+3LIaT2LvB60W3UiP+sGTdsnDIbtGNTmRp9rdHWHvELU12Zp+yw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713347080; c=relaxed/simple; bh=eDRjQdhAbLE6BqN1Ud/CgR+Kdu9mwTXnPdJoS2CdeO8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=V2dfdReYtE4HxrogN2wcbbPSiEEaY8E54ppeKMl7pR2WFtuLIP6qVL+5Bc0ZbDx/RLaEEd+tZbG1ujPMbDpOKGXUjUu9S7x26OcDY6227610PDHr90a5CR8EjuY0VyoXm2UUGLxgbMXcIXYdFWZPxggn+9tPXuSYb8JyYEsOGsE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IZQaHVrx; 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="IZQaHVrx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EC6CC072AA; Wed, 17 Apr 2024 09:44:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713347079; bh=eDRjQdhAbLE6BqN1Ud/CgR+Kdu9mwTXnPdJoS2CdeO8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=IZQaHVrxnHfNcb/72e0jHrNHLXIrSp+aeOGJ0BtR0A0ihJUjxJXhbVNQLvdDR8J/H OhOPAhSs5A7nKJ8+aruWAWt0W5OGJv1rSngaOwzdIYf83gVxmAlGdjuBcm0UpWrssC RZLcwuZ21x/ALmgosodjpcmQn3j+K/Z91LXPgoss= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26821: fs: relax mount_setattr() permission checks Date: Wed, 17 Apr 2024 11:44:04 +0200 Message-ID: <2024041702-CVE-2024-26821-de6b@gregkh> X-Mailer: git-send-email 2.44.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=2726; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=eDRjQdhAbLE6BqN1Ud/CgR+Kdu9mwTXnPdJoS2CdeO8=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnyMx+xJnxf2q/R6Ht/Q4nGphWbm2R3f/UxeJZ6t//+3 z9yPDN6O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAix40YFmy8dHJH2bP2TgWu q8u33jp3SpHnrCHD/NrW1tWXPcTfz9cN2Lnx1SWli1OUmQA= 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: fs: relax mount_setattr() permission checks When we added mount_setattr() I added additional checks compared to the legacy do_reconfigure_mnt() and do_change_type() helpers used by regular mount(2). If that mount had a parent then verify that the caller and the mount namespace the mount is attached to match and if not make sure that it's an anonymous mount. The real rootfs falls into neither category. It is neither an anoymous mount because it is obviously attached to the initial mount namespace but it also obviously doesn't have a parent mount. So that means legacy mount(2) allows changing mount properties on the real rootfs but mount_setattr(2) blocks this. I never thought much about this but of course someone on this planet of earth changes properties on the real rootfs as can be seen in [1]. Since util-linux finally switched to the new mount api in 2.39 not so long ago it also relies on mount_setattr() and that surfaced this issue when Fedora 39 finally switched to it. Fix this. The Linux kernel CVE team has assigned CVE-2024-26821 to this issue. Affected and fixed versions =========================== Fixed in 6.1.79 with commit 95de4ad173ca Fixed in 6.6.18 with commit 31f71f2d7a08 Fixed in 6.7.6 with commit 2a7a31e1fb97 Fixed in 6.8 with commit 46f5ab762d04 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-2024-26821 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/95de4ad173ca0e61034f3145d66917970961c210 https://git.kernel.org/stable/c/31f71f2d7a081fc6c6bdf06865beedf6db5b0ca4 https://git.kernel.org/stable/c/2a7a31e1fb9717845d9d5e2a8c6e48848147801e https://git.kernel.org/stable/c/46f5ab762d048dad224436978315cbc2fa79c630