From mboxrd@z Thu Jan 1 00:00:00 1970 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 1055D1C287 for ; Thu, 22 Aug 2024 03:34:06 +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=1724297646; cv=none; b=gHRsTfB8w3erueTOU+iW833wi3jJnsNJO949//YG3v29AYvb4cJmA9d45vOtWWncDqExct2czCtNOGfFAF3HgvqLN9TUFDcV/9xyvJvM/ZxPISZ+m5qqq1yZDBnZuAsAZfqdOw9yae6T4976PQdvmeegu7L7rSTE/T77QrG17iM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724297646; c=relaxed/simple; bh=nZC2A/lhN1zPktC+swJq2faRS1dj9a8Z3i9IvMB1HQI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hJncIlHDwG0xFYlIReYQH1coE+y6r75T9SVn+F66G4JFUEYSSNbFCcMC9i03B7TLTCYNTLM634P4SIz3jiIDseXjDdIcTSJBdepCC2Lizl5/JrD9DW6sRmvwljF8OJxE7SJf9Jzx3KPilgUyN7rmCPl1YjvliaKawx5Xg9KmPZs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RNogBLF7; 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="RNogBLF7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EA73C4AF0B; Thu, 22 Aug 2024 03:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724297645; bh=nZC2A/lhN1zPktC+swJq2faRS1dj9a8Z3i9IvMB1HQI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=RNogBLF7Bf1XEgiyIAHnt+6AIEtqzu1h32D2dZ5S4imYq92DwL4qO0udcWOmJd7eP /aDsL++ydETV++dB3fmO/fClt37NufRGhELRBTDX5fU0XVSKhxD8aEty/C8Zjn0RcS VIMujspgIxtMtOBKZOtfb/eAPeAIeOZf9o2DvzrE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48936: gso: do not skip outer ip header in case of ipip and net_failover Date: Thu, 22 Aug 2024 11:31:37 +0800 Message-ID: <2024082224-CVE-2022-48936-9302@gregkh> X-Mailer: git-send-email 2.46.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=4627; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=nZC2A/lhN1zPktC+swJq2faRS1dj9a8Z3i9IvMB1HQI=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnHNvK0vl18/EVml5jYMonP/5kdD0tc/PHSWlNsodUVn u+Sto03O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAihucZFpxlVd044ajVLsu/ FWvmfFyo5iY3VYdhfmjp8tn8KzYlbOaarzLZryDUjvvPPQA= 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: gso: do not skip outer ip header in case of ipip and net_failover We encounter a tcp drop issue in our cloud environment. Packet GROed in host forwards to a VM virtio_net nic with net_failover enabled. VM acts as a IPVS LB with ipip encapsulation. The full path like: host gro -> vm virtio_net rx -> net_failover rx -> ipvs fullnat -> ipip encap -> net_failover tx -> virtio_net tx When net_failover transmits a ipip pkt (gso_type = 0x0103, which means SKB_GSO_TCPV4, SKB_GSO_DODGY and SKB_GSO_IPXIP4), there is no gso did because it supports TSO and GSO_IPXIP4. But network_header points to inner ip header. Call Trace: tcp4_gso_segment ------> return NULL inet_gso_segment ------> inner iph, network_header points to ipip_gso_segment inet_gso_segment ------> outer iph skb_mac_gso_segment Afterwards virtio_net transmits the pkt, only inner ip header is modified. And the outer one just keeps unchanged. The pkt will be dropped in remote host. Call Trace: inet_gso_segment ------> inner iph, outer iph is skipped skb_mac_gso_segment __skb_gso_segment validate_xmit_skb validate_xmit_skb_list sch_direct_xmit __qdisc_run __dev_queue_xmit ------> virtio_net dev_hard_start_xmit __dev_queue_xmit ------> net_failover ip_finish_output2 ip_output iptunnel_xmit ip_tunnel_xmit ipip_tunnel_xmit ------> ipip dev_hard_start_xmit __dev_queue_xmit ip_finish_output2 ip_output ip_forward ip_rcv __netif_receive_skb_one_core netif_receive_skb_internal napi_gro_receive receive_buf virtnet_poll net_rx_action The root cause of this issue is specific with the rare combination of SKB_GSO_DODGY and a tunnel device that adds an SKB_GSO_ tunnel option. SKB_GSO_DODGY is set from external virtio_net. We need to reset network header when callbacks.gso_segment() returns NULL. This patch also includes ipv6_gso_segment(), considering SIT, etc. The Linux kernel CVE team has assigned CVE-2022-48936 to this issue. Affected and fixed versions =========================== Issue introduced in 3.13 with commit cb32f511a70b and fixed in 4.9.304 with commit 45d006c2c7ed Issue introduced in 3.13 with commit cb32f511a70b and fixed in 4.14.269 with commit 7840e559799a Issue introduced in 3.13 with commit cb32f511a70b and fixed in 4.19.232 with commit e9ffbe63f6f3 Issue introduced in 3.13 with commit cb32f511a70b and fixed in 5.4.182 with commit 2b3cdd70ea5f Issue introduced in 3.13 with commit cb32f511a70b and fixed in 5.10.103 with commit dac2490d9ee0 Issue introduced in 3.13 with commit cb32f511a70b and fixed in 5.15.26 with commit 899e56a1ad43 Issue introduced in 3.13 with commit cb32f511a70b and fixed in 5.16.12 with commit a739963f4326 Issue introduced in 3.13 with commit cb32f511a70b and fixed in 5.17 with commit cc20cced0598 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-48936 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/af_inet.c net/ipv6/ip6_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/45d006c2c7ed7baf1fa258fa7b5bc9923d3a983e https://git.kernel.org/stable/c/7840e559799a08a8588ee6de27516a991cb2e5e7 https://git.kernel.org/stable/c/e9ffbe63f6f32f526a461756309b61c395168d73 https://git.kernel.org/stable/c/2b3cdd70ea5f5a694f95ea1788393fb3b83071ea https://git.kernel.org/stable/c/dac2490d9ee0b89dffc72f1172b8bbeb60eaec39 https://git.kernel.org/stable/c/899e56a1ad435261812355550ae869d8be3df395 https://git.kernel.org/stable/c/a739963f43269297c3f438b776194542e2a97499 https://git.kernel.org/stable/c/cc20cced0598d9a5ff91ae4ab147b3b5e99ee819