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 B685A2E85D for ; Mon, 18 Mar 2024 10:21:28 +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=1710757288; cv=none; b=OFv1XWsHABK3vvoWoza1FNo4txDTsffpKsmuzSHYn1nRkDI9L7szixq1A73PtDxbT6PUMRwKVKP2FNJNuUTSk/6nmMk7yMwFpKi6M+BIng6P7R30xAb3U8emOsQmItC2hEl8QN8qLirWu32xNi17wtzSeKAEfUygpV9CmzMlk+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710757288; c=relaxed/simple; bh=DgwyN4eN0uFy8nT4odbHe71DHvwxz2qbbncxs5ukJO4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=M3bGu0oyXgULJYAiiLv/f+6iokPZZNTtUp4kCNNuviHZdKsa/iWO+GM2vrFEP/Q6qU/FP1dNG+7+vXl+fnDe0GWbkvDiCP9EiecAylANmoCV7xToGKS83bGtwzAanmqd9r/Uc1n19TkoJmbSh6D5diwVTSmA6b+PtyBrqnxktLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OD756jmb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OD756jmb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94B70C43394; Mon, 18 Mar 2024 10:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710757288; bh=DgwyN4eN0uFy8nT4odbHe71DHvwxz2qbbncxs5ukJO4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=OD756jmbtbJrB8zlPga4bgDiVb7Xhvp2pzQ3hL5grpZ0LQluxcaBuHE8godIjjPid 25qY1vjWAGEoRfEYmiZEwf5amnevzcuF0lh3mWyW8t94xnMtKq2Kzpdr8Xg6vZcs5d tDLKHBrIDL6cLTUHf+FKUBo7isULbCyErz9Ou2FU5bCbF3BCtGQRT7iZ5Cg0ZkTfvQ w2EPNy77F1NdS7OPjLyjeldMZ3l2s7cvOxOxnhhVx2W/gOsULq+nbrsi2zXCQ8a3Os R5yG6eq03VeBOkc8oWKiEYfVbJlFoJiibDIiZuGLZhqn4QsGek10K0CAm00IA0KVXS CfII2UsimZVNw== From: Lee Jones To: linux-cve-announce@vger.kernel.org Cc: Lee Jones Subject: CVE-2024-26641: ip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv() Date: Mon, 18 Mar 2024 10:21:23 +0000 Message-ID: <20240318102117.2839904-12-lee@kernel.org> X-Mailer: git-send-email 2.44.0.291.gc1ea87d7ee-goog 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=5788; i=lee@kernel.org; h=from:subject; bh=DgwyN4eN0uFy8nT4odbHe71DHvwxz2qbbncxs5ukJO4=; b=owEBbQKS/ZANAwAKAVGvii+H/HdhAcsmYgBl+BWdTJ4k9xq0/3eDmN+TPVRm4CNxJXA1j7SnX PkiSzds4zCJAjMEAAEKAB0WIQR2tsk1o74gmpTwh0hRr4ovh/x3YQUCZfgVnQAKCRBRr4ovh/x3 YcFZD/sFQv3C4d4V5rdAm2aWTNB0eyfH2Zm58nIVvvoF667AeUm96WKl4+W0zvyQKYLNU7x2ypX SJCCwrFzf8Uxijx28D5GPDx9m8KmXv1xL9Zro0SZsysy/Nu7KwdhiheOh1oiWdKocCbrzBeekSL uzZhqOLxBavveMojdVYSSs8POSBwp/tzUqbAQQ1QeoLhN/2ZIdy69cVZuDtj60j16UeHmdCcsHJ caTJ3UTWhf7bdz6V0v/lUWuIX852G7VlctFf1r0YltsQElTY2yUmeiUPCNE1MY0rLH7zTxMaeS+ NUodirOsn1zFYqSUmDGCDS0Yq6m92S/45TuspkvHGaWlFJpdlv5GM1qGcjCW53aqeeu+a8yjMXz pUvozYHSgYALVSlJOrWea/9ASgfEaPuhDnws+YspJcT38fSaNXQD1GCUaGlSO7BsUE0ftNI4fxA Z3KdUFcCvJS+jMFicLa9W/HMQLQzsnVgIOT8xQG3ZHYCa0haaOuUyNHUcXRmw5nT9bBZ84FAU3F bpteHKUt01uJB/rjvoAZFaqafdIbD1JwllhM8NMnfV1N2Am9QRJK7cJQwWBzoiiSGyIaH8vmtcq NrKiwzGvvwb25razgPej+SIf2IrDEEoceBhE8VkJR6ND4Rr1xxEhjcCOgbYhXxdBencSAucxDSp GkdiRsP+NibjYEg== X-Developer-Key: i=lee@kernel.org; a=openpgp; fpr=76B6C935A3BE209A94F0874851AF8A2F87FC7761 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: ip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv() syzbot found __ip6_tnl_rcv() could access unitiliazed data [1]. Call pskb_inet_may_pull() to fix this, and initialize ipv6h variable after this call as it can change skb->head. [1] BUG: KMSAN: uninit-value in __INET_ECN_decapsulate include/net/inet_ecn.h:253 [inline] BUG: KMSAN: uninit-value in INET_ECN_decapsulate include/net/inet_ecn.h:275 [inline] BUG: KMSAN: uninit-value in IP6_ECN_decapsulate+0x7df/0x1e50 include/net/inet_ecn.h:321 __INET_ECN_decapsulate include/net/inet_ecn.h:253 [inline] INET_ECN_decapsulate include/net/inet_ecn.h:275 [inline] IP6_ECN_decapsulate+0x7df/0x1e50 include/net/inet_ecn.h:321 ip6ip6_dscp_ecn_decapsulate+0x178/0x1b0 net/ipv6/ip6_tunnel.c:727 __ip6_tnl_rcv+0xd4e/0x1590 net/ipv6/ip6_tunnel.c:845 ip6_tnl_rcv+0xce/0x100 net/ipv6/ip6_tunnel.c:888 gre_rcv+0x143f/0x1870 ip6_protocol_deliver_rcu+0xda6/0x2a60 net/ipv6/ip6_input.c:438 ip6_input_finish net/ipv6/ip6_input.c:483 [inline] NF_HOOK include/linux/netfilter.h:314 [inline] ip6_input+0x15d/0x430 net/ipv6/ip6_input.c:492 ip6_mc_input+0xa7e/0xc80 net/ipv6/ip6_input.c:586 dst_input include/net/dst.h:461 [inline] ip6_rcv_finish+0x5db/0x870 net/ipv6/ip6_input.c:79 NF_HOOK include/linux/netfilter.h:314 [inline] ipv6_rcv+0xda/0x390 net/ipv6/ip6_input.c:310 __netif_receive_skb_one_core net/core/dev.c:5532 [inline] __netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5646 netif_receive_skb_internal net/core/dev.c:5732 [inline] netif_receive_skb+0x58/0x660 net/core/dev.c:5791 tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1555 tun_get_user+0x53af/0x66d0 drivers/net/tun.c:2002 tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2048 call_write_iter include/linux/fs.h:2084 [inline] new_sync_write fs/read_write.c:497 [inline] vfs_write+0x786/0x1200 fs/read_write.c:590 ksys_write+0x20f/0x4c0 fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __x64_sys_write+0x93/0xd0 fs/read_write.c:652 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x6d/0x140 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Uninit was created at: slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768 slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x5e9/0xb10 mm/slub.c:3523 kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:560 __alloc_skb+0x318/0x740 net/core/skbuff.c:651 alloc_skb include/linux/skbuff.h:1286 [inline] alloc_skb_with_frags+0xc8/0xbd0 net/core/skbuff.c:6334 sock_alloc_send_pskb+0xa80/0xbf0 net/core/sock.c:2787 tun_alloc_skb drivers/net/tun.c:1531 [inline] tun_get_user+0x1e8a/0x66d0 drivers/net/tun.c:1846 tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2048 call_write_iter include/linux/fs.h:2084 [inline] new_sync_write fs/read_write.c:497 [inline] vfs_write+0x786/0x1200 fs/read_write.c:590 ksys_write+0x20f/0x4c0 fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __x64_sys_write+0x93/0xd0 fs/read_write.c:652 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x6d/0x140 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b CPU: 0 PID: 5034 Comm: syz-executor331 Not tainted 6.7.0-syzkaller-00562-g9f8413c4a66f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 The Linux kernel CVE team has assigned CVE-2024-26641 to this issue. Affected and fixed versions =========================== Issue introduced in 4.7 with commit 0d3c703a9d17 and fixed in 5.10.210 with commit a9bc32879a08 Issue introduced in 4.7 with commit 0d3c703a9d17 and fixed in 5.15.149 with commit af6b5c50d47a Issue introduced in 4.7 with commit 0d3c703a9d17 and fixed in 6.1.77 with commit d54e4da98bbf Issue introduced in 4.7 with commit 0d3c703a9d17 and fixed in 6.6.16 with commit 350a6640fac4 Issue introduced in 4.7 with commit 0d3c703a9d17 and fixed in 6.7.4 with commit c835df3bcc14 Issue introduced in 4.7 with commit 0d3c703a9d17 and fixed in 6.8 with commit 8d975c15c0cd 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-2024-26641 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/ipv6/ip6_tunnel.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/a9bc32879a08f23cdb80a48c738017e39aea1080 https://git.kernel.org/stable/c/af6b5c50d47ab43e5272ad61935d0ed2e264d3f0 https://git.kernel.org/stable/c/d54e4da98bbfa8c257bdca94c49652d81d18a4d8 https://git.kernel.org/stable/c/350a6640fac4b53564ec20aa3f4a0922cb0ba5e6 https://git.kernel.org/stable/c/c835df3bcc14858ae9b27315dd7de76370b94f3a https://git.kernel.org/stable/c/8d975c15c0cd744000ca386247432d57b21f9df0