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 362FE1DC753 for ; Mon, 21 Oct 2024 20:11:21 +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=1729541481; cv=none; b=WvA7ILKAASZ3NGm690tTope84ehSbPnuf0RZLLJtCuuLvbAUpmQs2ncVZED6eIsuZuxziCQcTSNtL7z5Ud5kk0tzL3Ux9/SdlaWuF9ehe42YYpkgrYnVuvTdf71+a7slziX0U13ia+VF9B8z0ITEjkWKBMMcRdz3JSc65KigDzA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729541481; c=relaxed/simple; bh=7EZi/Rbcv7PUB4AWNHNVNKbr94BN5HfmHLQCLna4Fmc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=heWi61UjoyI/Q2GQXUjVq1jz+PYc3et+nY+GcW9uSVsNusqS/XN4uJ4eR6BkRBSlPmguxVjl3kHs5yGsVckgRtB2T4I6IQOwXqZebwwbRHORq7//T96zvMreWNesN9QKthLbxu6u3oSYQ8vKd2aTdcjN5TppDgC0eji0qZ42FJU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NTUKKLzv; 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="NTUKKLzv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8B9FC4CEC3; Mon, 21 Oct 2024 20:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729541481; bh=7EZi/Rbcv7PUB4AWNHNVNKbr94BN5HfmHLQCLna4Fmc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=NTUKKLzvmTrNjdLP2Dva+31hPQoULrhO8vVURX/Av30Kvv3YOpF7Mnffke6N7PZSp ElI3ONMPOR7cxJmKBrdNoo+gKjnnFoLtRpUbVpYm5/UwOqFPAr1vEOmgDIUAn/NKrH UhrZ8eNXuNajwu0XN9iRj70qSOmfCeBYU/BgVOE8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48976: netfilter: flowtable_offload: fix using __this_cpu_add in preemptible Date: Mon, 21 Oct 2024 22:06:08 +0200 Message-ID: <2024102145-CVE-2022-48976-2980@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=2830; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=7EZi/Rbcv7PUB4AWNHNVNKbr94BN5HfmHLQCLna4Fmc=; b=owGbwMvMwCRo6H6F97bub03G02pJDOliWySrWlQ3cPRwutx7PuGoZeectIXsNbUzEo9MVnqw1 VreM/taRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkdhLDgmscPRlrfEu13i// vffBP3aFDrHp3Azz7NqTdeNSrlVE/aotW7LgxyOn89cmAQA= 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: flowtable_offload: fix using __this_cpu_add in preemptible flow_offload_queue_work() can be called in workqueue without bh disabled, like the call trace showed in my act_ct testing, calling NF_FLOW_TABLE_STAT_INC() there would cause a call trace: BUG: using __this_cpu_add() in preemptible [00000000] code: kworker/u4:0/138560 caller is flow_offload_queue_work+0xec/0x1b0 [nf_flow_table] Workqueue: act_ct_workqueue tcf_ct_flow_table_cleanup_work [act_ct] Call Trace: dump_stack_lvl+0x33/0x46 check_preemption_disabled+0xc3/0xf0 flow_offload_queue_work+0xec/0x1b0 [nf_flow_table] nf_flow_table_iterate+0x138/0x170 [nf_flow_table] nf_flow_table_free+0x140/0x1a0 [nf_flow_table] tcf_ct_flow_table_cleanup_work+0x2f/0x2b0 [act_ct] process_one_work+0x6a3/0x1030 worker_thread+0x8a/0xdf0 This patch fixes it by using NF_FLOW_TABLE_STAT_INC_ATOMIC() instead in flow_offload_queue_work(). Note that for FLOW_CLS_REPLACE branch in flow_offload_queue_work(), it may not be called in preemptible path, but it's good to use NF_FLOW_TABLE_STAT_INC_ATOMIC() for all cases in flow_offload_queue_work(). The Linux kernel CVE team has assigned CVE-2022-48976 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit b038177636f8 and fixed in 6.0.13 with commit a220a11fda01 Issue introduced in 6.0 with commit b038177636f8 and fixed in 6.1 with commit a81047154e7c Issue introduced in 5.15.157 with commit 5345d78ae64d 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-48976 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_flow_table_offload.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/a220a11fda012fba506b35929672374c2723ae6d https://git.kernel.org/stable/c/a81047154e7ce4eb8769d5d21adcbc9693542a79