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 BCC8A1FBC95 for ; Mon, 21 Oct 2024 18:06:23 +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=1729533983; cv=none; b=XnSN2Lqzo2bEEb/Acl48uCcCQYiaRK/qLADnu2X5kS2fqvfUDZL9SNlozrcN0Lam3srK/XndJ+ysfB3DUMQRpHmut2C8GeG3sbZeiGi++yOwftA5G7ySq7gY3mlBWaTtB0uZ+PTic+QN1k+XBwhhvY+vAHXMcSm2Pxpq5U9cfQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729533983; c=relaxed/simple; bh=J4t44r6Edzsu+5OawcRJOyYQhuMhJnJeI9T/yf6nReA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=M/q/ZO4LdN2/g0GGlCtarAWy/Y06pxoHSbcn/ihWHyGldt87zoicdCsPhAH8JhwWN2u9mDx0ph9Xq/ylMPFb8LTJ8r1WrzWFfoGaNglPZxnD0P+nsGFQDaLRqEPYfVM213LeSbMGlB7s0Q+fHccFVrW1Lcr6+mFcqKlQuyob0vY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gkVZFIp+; 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="gkVZFIp+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 414F8C4CEC3; Mon, 21 Oct 2024 18:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729533983; bh=J4t44r6Edzsu+5OawcRJOyYQhuMhJnJeI9T/yf6nReA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=gkVZFIp+KELPAjw8/HsgDKVcKaDxnloV04+wKiDVlyptjrRjPZWVvBo5SVpt3Ov/u xFJDAinHpxLdc5kMtaYWmKGTnzF3okpsHbHm3+9aVjBAnA9D1n0Bs4TUqJzKd8Bxsq 0Dn1dxnbZlVBhIK8dsi0T0sOKdnPcS0EQGVq4ouA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-49952: netfilter: nf_tables: prevent nf_skb_duplicated corruption Date: Mon, 21 Oct 2024 20:02:40 +0200 Message-ID: <2024102130-CVE-2024-49952-4b61@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=5298; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=J4t44r6Edzsu+5OawcRJOyYQhuMhJnJeI9T/yf6nReA=; b=owGbwMvMwCRo6H6F97bub03G02pJDOli036J6NtmnXuVr3li8ownf1J12lQjp81I/JFy+4kD+ 6e1bAfSOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiFpYMc3htlx7gyP62bott Tpt60opZsw68MWSYH52i7vfdXie/ZXqaNctR28P7JfXPAwA= 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: nf_tables: prevent nf_skb_duplicated corruption syzbot found that nf_dup_ipv4() or nf_dup_ipv6() could write per-cpu variable nf_skb_duplicated in an unsafe way [1]. Disabling preemption as hinted by the splat is not enough, we have to disable soft interrupts as well. [1] BUG: using __this_cpu_write() in preemptible [00000000] code: syz.4.282/6316 caller is nf_dup_ipv4+0x651/0x8f0 net/ipv4/netfilter/nf_dup_ipv4.c:87 CPU: 0 UID: 0 PID: 6316 Comm: syz.4.282 Not tainted 6.11.0-rc7-syzkaller-00104-g7052622fccb1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 check_preemption_disabled+0x10e/0x120 lib/smp_processor_id.c:49 nf_dup_ipv4+0x651/0x8f0 net/ipv4/netfilter/nf_dup_ipv4.c:87 nft_dup_ipv4_eval+0x1db/0x300 net/ipv4/netfilter/nft_dup_ipv4.c:30 expr_call_ops_eval net/netfilter/nf_tables_core.c:240 [inline] nft_do_chain+0x4ad/0x1da0 net/netfilter/nf_tables_core.c:288 nft_do_chain_ipv4+0x202/0x320 net/netfilter/nft_chain_filter.c:23 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_slow+0xc3/0x220 net/netfilter/core.c:626 nf_hook+0x2c4/0x450 include/linux/netfilter.h:269 NF_HOOK_COND include/linux/netfilter.h:302 [inline] ip_output+0x185/0x230 net/ipv4/ip_output.c:433 ip_local_out net/ipv4/ip_output.c:129 [inline] ip_send_skb+0x74/0x100 net/ipv4/ip_output.c:1495 udp_send_skb+0xacf/0x1650 net/ipv4/udp.c:981 udp_sendmsg+0x1c21/0x2a60 net/ipv4/udp.c:1269 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x1a6/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2597 ___sys_sendmsg net/socket.c:2651 [inline] __sys_sendmmsg+0x3b2/0x740 net/socket.c:2737 __do_sys_sendmmsg net/socket.c:2766 [inline] __se_sys_sendmmsg net/socket.c:2763 [inline] __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2763 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4ce4f7def9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4ce5d4a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f4ce5135f80 RCX: 00007f4ce4f7def9 RDX: 0000000000000001 RSI: 0000000020005d40 RDI: 0000000000000006 RBP: 00007f4ce4ff0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4ce5135f80 R15: 00007ffd4cbc6d68 The Linux kernel CVE team has assigned CVE-2024-49952 to this issue. Affected and fixed versions =========================== Issue introduced in 4.3 with commit d877f07112f1 and fixed in 5.10.227 with commit 531754952f5d Issue introduced in 4.3 with commit d877f07112f1 and fixed in 5.15.168 with commit 38e3fd0c4a26 Issue introduced in 4.3 with commit d877f07112f1 and fixed in 6.1.113 with commit b40b027a0c0c Issue introduced in 4.3 with commit d877f07112f1 and fixed in 6.6.55 with commit 4e3542f40f3a Issue introduced in 4.3 with commit d877f07112f1 and fixed in 6.10.14 with commit f839c5cd3482 Issue introduced in 4.3 with commit d877f07112f1 and fixed in 6.11.3 with commit 752e19246042 Issue introduced in 4.3 with commit d877f07112f1 and fixed in 6.12-rc2 with commit 92ceba94de6f 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-49952 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/ipv4/netfilter/nf_dup_ipv4.c net/ipv6/netfilter/nf_dup_ipv6.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/531754952f5dfc4b141523088147071d6e6112c4 https://git.kernel.org/stable/c/38e3fd0c4a2616052eb3c8f4e6f32d1ff47cd663 https://git.kernel.org/stable/c/b40b027a0c0cc1cb9471a13f9730bb2fff12a15b https://git.kernel.org/stable/c/4e3542f40f3a94efa59ea328e307c50601ed7065 https://git.kernel.org/stable/c/f839c5cd348201fec440d987cbca9b979bdb4fa7 https://git.kernel.org/stable/c/752e1924604254f1708f3e3700283a86ebdd325d https://git.kernel.org/stable/c/92ceba94de6fb4cee2bf40b485979c342f44a492