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 9B4CD171095 for ; Fri, 21 Jun 2024 10:25:09 +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=1718965509; cv=none; b=htOFntGjUOehm9AFEslt5OQQCVb4uHWNK3TcxgZBYJhkml+ioRdrX9C78BDRamgKKJU66REJ1u+QpBDi8VEJEGqu+QNl6wpVlJUvi8aEyR+n++Lkvt8+TCJLmcRrs4RJ3bCToLfybdVcADCPxMkN13wsnBpgztsAF1Z1MGvP0sg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718965509; c=relaxed/simple; bh=DskNu9CwUb+mIMk/oKOSZ8Qw3TFMCPbZhwmfznQ4Has=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kMytikvyPk+J0z9J4abLcbsObdC39rVxU4+IU1/4y2W5JPOH6QqWyMKbhPo4M6f7sJD6kZ71/ASJ+9yaQm/npc1Z/m2/98pKhTHqHET0CdW7k4rZ5QjRIk++GcwWDRiFwHy8XixtEurJNXkn2yETXJVleOLQzZxuBZ4Zr4I3Etg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VoIFK1e4; 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="VoIFK1e4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1897EC32781; Fri, 21 Jun 2024 10:25:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718965509; bh=DskNu9CwUb+mIMk/oKOSZ8Qw3TFMCPbZhwmfznQ4Has=; h=From:To:Cc:Subject:Date:Reply-to:From; b=VoIFK1e4H/ITvQx1aR5ueSuPn2tgLCLGdSv8sjEqnZXVYpi6ZScAMTAN+cT5f780y HLBZjAYqrudEMEXfyjrXDBBbN/wbfF/EBFagNeY9uSlOe8KrKaXFCnINfbTsmPFya+ 7ozA1lmefY5tMDZcAVre8x2eKPstEyG0+n1Hbgik= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-33621: ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound Date: Fri, 21 Jun 2024 12:19:33 +0200 Message-ID: <2024062134-CVE-2024-33621-d3a6@gregkh> X-Mailer: git-send-email 2.45.2 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=5782; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=DskNu9CwUb+mIMk/oKOSZ8Qw3TFMCPbZhwmfznQ4Has=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmlwdukt7xsvKzMx3C98nDlJXEj9xeXvj2K+cruVedUP FtReNGcjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjI3GaG+Ynvi+4L8X/9U/nn 1/ZXlyaxOIfL72NYcLrj7/Lw44eFO8zfWa2akpxcsz2yHQA= 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: ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound Raw packet from PF_PACKET socket ontop of an IPv6-backed ipvlan device will hit WARN_ON_ONCE() in sk_mc_loop() through sch_direct_xmit() path. WARNING: CPU: 2 PID: 0 at net/core/sock.c:775 sk_mc_loop+0x2d/0x70 Modules linked in: sch_netem ipvlan rfkill cirrus drm_shmem_helper sg drm_kms_helper CPU: 2 PID: 0 Comm: swapper/2 Kdump: loaded Not tainted 6.9.0+ #279 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:sk_mc_loop+0x2d/0x70 Code: fa 0f 1f 44 00 00 65 0f b7 15 f7 96 a3 4f 31 c0 66 85 d2 75 26 48 85 ff 74 1c RSP: 0018:ffffa9584015cd78 EFLAGS: 00010212 RAX: 0000000000000011 RBX: ffff91e585793e00 RCX: 0000000002c6a001 RDX: 0000000000000000 RSI: 0000000000000040 RDI: ffff91e589c0f000 RBP: ffff91e5855bd100 R08: 0000000000000000 R09: 3d00545216f43d00 R10: ffff91e584fdcc50 R11: 00000060dd8616f4 R12: ffff91e58132d000 R13: ffff91e584fdcc68 R14: ffff91e5869ce800 R15: ffff91e589c0f000 FS: 0000000000000000(0000) GS:ffff91e898100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f788f7c44c0 CR3: 0000000008e1a000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? __warn (kernel/panic.c:693) ? sk_mc_loop (net/core/sock.c:760) ? report_bug (lib/bug.c:201 lib/bug.c:219) ? handle_bug (arch/x86/kernel/traps.c:239) ? exc_invalid_op (arch/x86/kernel/traps.c:260 (discriminator 1)) ? asm_exc_invalid_op (./arch/x86/include/asm/idtentry.h:621) ? sk_mc_loop (net/core/sock.c:760) ip6_finish_output2 (net/ipv6/ip6_output.c:83 (discriminator 1)) ? nf_hook_slow (net/netfilter/core.c:626) ip6_finish_output (net/ipv6/ip6_output.c:222) ? __pfx_ip6_finish_output (net/ipv6/ip6_output.c:215) ipvlan_xmit_mode_l3 (drivers/net/ipvlan/ipvlan_core.c:602) ipvlan ipvlan_start_xmit (drivers/net/ipvlan/ipvlan_main.c:226) ipvlan dev_hard_start_xmit (net/core/dev.c:3594) sch_direct_xmit (net/sched/sch_generic.c:343) __qdisc_run (net/sched/sch_generic.c:416) net_tx_action (net/core/dev.c:5286) handle_softirqs (kernel/softirq.c:555) __irq_exit_rcu (kernel/softirq.c:589) sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1043) The warning triggers as this: packet_sendmsg packet_snd //skb->sk is packet sk __dev_queue_xmit __dev_xmit_skb //q->enqueue is not NULL __qdisc_run sch_direct_xmit dev_hard_start_xmit ipvlan_start_xmit ipvlan_xmit_mode_l3 //l3 mode ipvlan_process_outbound //vepa flag ipvlan_process_v6_outbound ip6_local_out __ip6_finish_output ip6_finish_output2 //multicast packet sk_mc_loop //sk->sk_family is AF_PACKET Call ip{6}_local_out() with NULL sk in ipvlan as other tunnels to fix this. The Linux kernel CVE team has assigned CVE-2024-33621 to this issue. Affected and fixed versions =========================== Issue introduced in 3.19 with commit 2ad7bf363841 and fixed in 4.19.316 with commit 0049a623dfbb Issue introduced in 3.19 with commit 2ad7bf363841 and fixed in 5.4.278 with commit 54768bacfde6 Issue introduced in 3.19 with commit 2ad7bf363841 and fixed in 5.10.219 with commit 1abbf079da59 Issue introduced in 3.19 with commit 2ad7bf363841 and fixed in 5.15.161 with commit 183c4b416454 Issue introduced in 3.19 with commit 2ad7bf363841 and fixed in 6.1.93 with commit cb53706a3403 Issue introduced in 3.19 with commit 2ad7bf363841 and fixed in 6.6.33 with commit 54213c09801e Issue introduced in 3.19 with commit 2ad7bf363841 and fixed in 6.9.4 with commit 13c4543db34e Issue introduced in 3.19 with commit 2ad7bf363841 and fixed in 6.10-rc2 with commit b3dc6e8003b5 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-33621 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: drivers/net/ipvlan/ipvlan_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/0049a623dfbbb49888de7f0c2f33a582b5ead989 https://git.kernel.org/stable/c/54768bacfde60e8e4757968d79f8726711dd2cf5 https://git.kernel.org/stable/c/1abbf079da59ef559d0ab4219d2a0302f7970761 https://git.kernel.org/stable/c/183c4b416454b9983dc1b8aa0022b748911adc48 https://git.kernel.org/stable/c/cb53706a3403ba67f4040b2a82d9cf79e11b1a48 https://git.kernel.org/stable/c/54213c09801e0bd2549ac42961093be36f65a7d0 https://git.kernel.org/stable/c/13c4543db34e0da5a7d2f550b6262d860f248381 https://git.kernel.org/stable/c/b3dc6e8003b500861fa307e9a3400c52e78e4d3a