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 6D6101DFD81 for ; Mon, 21 Oct 2024 20:11:11 +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=1729541471; cv=none; b=axZwVROr+yYl+rCdDk6hSdYP68cku6BEpK1v96FvsNIqdaxw4tppetnzKF/jfERChoQtsi8YCiz07UUiw02up+EGtn162/y4KcKkhAZ9ILIANvCL8oHVQlPjqips0IAxYlGJTzrD2/ruPNT1mcEqqxe7dTfxNsccXTnPt6e2SGo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729541471; c=relaxed/simple; bh=VUi8jMZJroDy7G4qji7zWgRnqqQ2n4vQQn5A9fU56uU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TL2iwYHyEDfTVpCHXEq8oWa4/HzitutMtTxU1h6kMNdzBD9BE4aER4QvDY/tz2XrJTNb8AozgQkepbIRSHDz8sWYt6p/tPk9vIK7NHdaMS1R4MOhz/l5WNdpYqOm18WcpJvcwRe6EiF50+HVH6+l7dOfltnVlVntdIHq7QOrU2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cmpPDCdw; 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="cmpPDCdw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD834C4CEC3; Mon, 21 Oct 2024 20:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729541471; bh=VUi8jMZJroDy7G4qji7zWgRnqqQ2n4vQQn5A9fU56uU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=cmpPDCdw9wc5fGzERpfyjiW41eeMtNk/64Ns9pufBPDx81gLsALjEdavmtQcW/lgE rxZZN0vKlkPjqaxhtPslnPAkQDCCAfRrBLLMDAf3RQKTY98AQMdV29xWckYKXa2iwX gSg6ur5RCowSeydQmakuNkDP2oa2uzo3CWkstQBo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48974: netfilter: conntrack: fix using __this_cpu_add in preemptible Date: Mon, 21 Oct 2024 22:06:06 +0200 Message-ID: <2024102145-CVE-2022-48974-d2d0@gregkh> X-Mailer: git-send-email 2.47.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=2854; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=VUi8jMZJroDy7G4qji7zWgRnqqQ2n4vQQn5A9fU56uU=; b=owGbwMvMwCRo6H6F97bub03G02pJDOliWyRb/7+YvM5czczab2fpYqZrKgt85R4Vm4Q212SyL 8kKuJjaEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPRWsew4JLhRP/g5icipQ92 vU3Qnsp907NxF8M8pQLP4qOnzuXUdK28oXzYYcFUd7m5AA== 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: fix using __this_cpu_add in preemptible Currently in nf_conntrack_hash_check_insert(), when it fails in nf_ct_ext_valid_pre/post(), NF_CT_STAT_INC() will be called in the preemptible context, a call trace can be triggered: BUG: using __this_cpu_add() in preemptible [00000000] code: conntrack/1636 caller is nf_conntrack_hash_check_insert+0x45/0x430 [nf_conntrack] Call Trace: dump_stack_lvl+0x33/0x46 check_preemption_disabled+0xc3/0xf0 nf_conntrack_hash_check_insert+0x45/0x430 [nf_conntrack] ctnetlink_create_conntrack+0x3cd/0x4e0 [nf_conntrack_netlink] ctnetlink_new_conntrack+0x1c0/0x450 [nf_conntrack_netlink] nfnetlink_rcv_msg+0x277/0x2f0 [nfnetlink] netlink_rcv_skb+0x50/0x100 nfnetlink_rcv+0x65/0x144 [nfnetlink] netlink_unicast+0x1ae/0x290 netlink_sendmsg+0x257/0x4f0 sock_sendmsg+0x5f/0x70 This patch is to fix it by changing to use NF_CT_STAT_INC_ATOMIC() for nf_ct_ext_valid_pre/post() check in nf_conntrack_hash_check_insert(), as well as nf_ct_ext_valid_post() in __nf_conntrack_confirm(). Note that nf_ct_ext_valid_pre() check in __nf_conntrack_confirm() is safe to use NF_CT_STAT_INC(), as it's under local_bh_disable(). The Linux kernel CVE team has assigned CVE-2022-48974 to this issue. Affected and fixed versions =========================== Issue introduced in 5.19 with commit c56716c69ce1 and fixed in 6.0.13 with commit d9bf1138a5db Issue introduced in 5.19 with commit c56716c69ce1 and fixed in 6.1 with commit 9464d0b68f11 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-2022-48974 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_core.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/d9bf1138a5db419db13bd9fcd3a7178d6bb20f7c https://git.kernel.org/stable/c/9464d0b68f11a9bc768370c3260ec02b3550447b