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 9DEBF5026F for ; Tue, 27 Feb 2024 18:48:05 +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=1709059685; cv=none; b=iRIJfaz9gZ5s8KeqgYIcsED7sCjv2VAJnTgar7pZ1voxvIHe3TA2Gdsi+M2J9yH0cOYMogtvCKgaj+3L/6/KE6yO1ZskMgaKH4i3cGCtVrAKbZygasWJq7UKxYLGQXuvKDMv2eXpQd20HyYUoBUJY6MhZbMtmcCI144xmQ6aF6w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709059685; c=relaxed/simple; bh=DHj3OeBqZY78gXmt/QWWg+v/aB78w0cqD/2mk5MaLhc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZcmHqdFLLeKp7JQDqrw203LHwnv5nJSVpFj3BeKLyZ2iuKjY2K8kvQN+nWjE40k0vzy1Bs0s7bUoTJqhziY3qh+P/tm/rrA4OsZFKQzy9WH6jw9ha7GsgN5JRakqNdoEr70Fj6qQqGn2IOxu3YwtKnMYytxo76wG5I1laR05wd4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=o+EQEmiZ; 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="o+EQEmiZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 295E2C433B1; Tue, 27 Feb 2024 18:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709059685; bh=DHj3OeBqZY78gXmt/QWWg+v/aB78w0cqD/2mk5MaLhc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=o+EQEmiZ2fFy9Z2g8VSnQVwihYk9pTnlu5cWxam+o5s66UCQIyQt/+9DheSXJZSUj rB7wyrMlVLo3zl4nOt6g20hIVXhMqF5PLUA6U8+XaJWJXhjRCYqP9KHWKOFhlpFs/Z lXi5B3PXNRpJ0xGcX5JwnTk96RU0UuZUcIBKQN3k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-46975: netfilter: conntrack: Make global sysctls readonly in non-init netns Date: Tue, 27 Feb 2024 19:47:35 +0100 Message-ID: <2024022721-CVE-2021-46975-248d@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=3584; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=DHj3OeBqZY78gXmt/QWWg+v/aB78w0cqD/2mk5MaLhc=; b=owGbwMvMwCRo6H6F97bub03G02pJDKn39CyzD55m3rr39IxvweznORtdH2/POlI25UdakLz3w kRdvsUqHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCROVYM8/2lUnMf2qpMXaml 6+TqE9C0KOyyMVBUPmL9i5IZIkUVwroSsYkr5ph51AEA 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: netfilter: conntrack: Make global sysctls readonly in non-init netns These sysctls point to global variables: - NF_SYSCTL_CT_MAX (&nf_conntrack_max) - NF_SYSCTL_CT_EXPECT_MAX (&nf_ct_expect_max) - NF_SYSCTL_CT_BUCKETS (&nf_conntrack_htable_size_user) Because their data pointers are not updated to point to per-netns structures, they must be marked read-only in a non-init_net ns. Otherwise, changes in any net namespace are reflected in (leaked into) all other net namespaces. This problem has existed since the introduction of net namespaces. The current logic marks them read-only only if the net namespace is owned by an unprivileged user (other than init_user_ns). Commit d0febd81ae77 ("netfilter: conntrack: re-visit sysctls in unprivileged namespaces") "exposes all sysctls even if the namespace is unpriviliged." Since we need to mark them readonly in any case, we can forego the unprivileged user check altogether. The Linux kernel CVE team has assigned CVE-2021-46975 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit d0febd81ae77 and fixed in 4.9.269 with commit da50f56e826e Issue introduced in 5.7 with commit d0febd81ae77 and fixed in 4.14.233 with commit 68122479c128 Issue introduced in 5.7 with commit d0febd81ae77 and fixed in 4.19.191 with commit 9b288479f7a9 Issue introduced in 5.7 with commit d0febd81ae77 and fixed in 5.4.120 with commit baea536cf51f Issue introduced in 5.7 with commit d0febd81ae77 and fixed in 5.10.35 with commit d3598eb3915c Issue introduced in 5.7 with commit d0febd81ae77 and fixed in 5.11.19 with commit fbf85a34ce17 Issue introduced in 5.7 with commit d0febd81ae77 and fixed in 5.12.2 with commit 671c54ea8c7f Issue introduced in 5.7 with commit d0febd81ae77 and fixed in 5.13 with commit 2671fa4dc010 Please see https://www.kernel.org or 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-2021-46975 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: net/netfilter/nf_conntrack_standalone.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/da50f56e826e1db141693297afb99370ebc160dd https://git.kernel.org/stable/c/68122479c128a929f8f7bdd951cfdc8dd0e75b8f https://git.kernel.org/stable/c/9b288479f7a901a14ce703938596438559d7df55 https://git.kernel.org/stable/c/baea536cf51f8180ab993e374cb134b5edad25e2 https://git.kernel.org/stable/c/d3598eb3915cc0c0d8cab42f4a6258ff44c4033e https://git.kernel.org/stable/c/fbf85a34ce17c4cf0a37ee253f4c582bbfb8231b https://git.kernel.org/stable/c/671c54ea8c7ff47bd88444f3fffb65bf9799ce43 https://git.kernel.org/stable/c/2671fa4dc0109d3fb581bc3078fdf17b5d9080f6