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 966D08633F for ; Sat, 28 Dec 2024 09:48:16 +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=1735379296; cv=none; b=jVl7bE0ygb6qfvYyFlDJaRB4N2u6Nx8dSiAyexoBFBMQH7pKgJQjPkxAW5ZTbyldmo5Zp6e7K0XGKm0MQ8tQAfaFCKi3NIcfdtSO0Smy1Cp913tANG2qW2QZbHCDgFpx54P1tnMzarTlnNV8qSaLU/zYU7fx73LzRnI59o+ek88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735379296; c=relaxed/simple; bh=XqQYnAyVw1Bp7T6qzjtCN2M1ruOR0z7u/JGm+XCQd74=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=n35tcoAcoCw01YSYWo0W7qG8nLP30VQGZydBSHTlmzsiLtdz/rIT59+jzcGsc6eAxItNAfLMRNGn3EudpO+Oc3/TOkWfQhDUygyM0YpqQZ4tXhPocV9Ng0Oo2pwyglrIjQthuuocsFRfO6rAnQB/2C8hZSwPcC4sasTbqzaXiFg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MnqVcPEz; 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="MnqVcPEz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 207A7C4CECD; Sat, 28 Dec 2024 09:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735379296; bh=XqQYnAyVw1Bp7T6qzjtCN2M1ruOR0z7u/JGm+XCQd74=; h=From:To:Cc:Subject:Date:Reply-to:From; b=MnqVcPEz06RnnPtqudLvjp9+ZxdsFTteemwk38Fk44kKnOe3zcHQDEmTGTv2HOckb 2CL95nfawwGOJ83MCdzqg7GtR2fyYvmwuU+mKbjPw+faEIHuE5LXan3I8rlIEKA6cN Lyd4rfkcTpCNYGsJTBk8QoX5LzRK//SUGURBNrZo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56703: ipv6: Fix soft lockups in fib6_select_path under high next hop churn Date: Sat, 28 Dec 2024 10:45:55 +0100 Message-ID: <2024122837-CVE-2024-56703-683a@gregkh> X-Mailer: git-send-email 2.47.1 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=5892; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=XqQYnAyVw1Bp7T6qzjtCN2M1ruOR0z7u/JGm+XCQd74=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn5Jw5ypyplBrqmb19yXudZEfu/+bM/shw77pD+7MXHp /0c+xd3dMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBErs9jmMXsIHrqUuXmOR1F Sjqv53Wk9Ty7eY5hrmCNkfn/Vmu7iG+5es2XLybNmLdlKgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: ipv6: Fix soft lockups in fib6_select_path under high next hop churn Soft lockups have been observed on a cluster of Linux-based edge routers located in a highly dynamic environment. Using the `bird` service, these routers continuously update BGP-advertised routes due to frequently changing nexthop destinations, while also managing significant IPv6 traffic. The lockups occur during the traversal of the multipath circular linked-list in the `fib6_select_path` function, particularly while iterating through the siblings in the list. The issue typically arises when the nodes of the linked list are unexpectedly deleted concurrently on a different core—indicated by their 'next' and 'previous' elements pointing back to the node itself and their reference count dropping to zero. This results in an infinite loop, leading to a soft lockup that triggers a system panic via the watchdog timer. Apply RCU primitives in the problematic code sections to resolve the issue. Where necessary, update the references to fib6_siblings to annotate or use the RCU APIs. Include a test script that reproduces the issue. The script periodically updates the routing table while generating a heavy load of outgoing IPv6 traffic through multiple iperf3 clients. It consistently induces infinite soft lockups within a couple of minutes. Kernel log: 0 [ffffbd13003e8d30] machine_kexec at ffffffff8ceaf3eb 1 [ffffbd13003e8d90] __crash_kexec at ffffffff8d0120e3 2 [ffffbd13003e8e58] panic at ffffffff8cef65d4 3 [ffffbd13003e8ed8] watchdog_timer_fn at ffffffff8d05cb03 4 [ffffbd13003e8f08] __hrtimer_run_queues at ffffffff8cfec62f 5 [ffffbd13003e8f70] hrtimer_interrupt at ffffffff8cfed756 6 [ffffbd13003e8fd0] __sysvec_apic_timer_interrupt at ffffffff8cea01af 7 [ffffbd13003e8ff0] sysvec_apic_timer_interrupt at ffffffff8df1b83d -- -- 8 [ffffbd13003d3708] asm_sysvec_apic_timer_interrupt at ffffffff8e000ecb [exception RIP: fib6_select_path+299] RIP: ffffffff8ddafe7b RSP: ffffbd13003d37b8 RFLAGS: 00000287 RAX: ffff975850b43600 RBX: ffff975850b40200 RCX: 0000000000000000 RDX: 000000003fffffff RSI: 0000000051d383e4 RDI: ffff975850b43618 RBP: ffffbd13003d3800 R8: 0000000000000000 R9: ffff975850b40200 R10: 0000000000000000 R11: 0000000000000000 R12: ffffbd13003d3830 R13: ffff975850b436a8 R14: ffff975850b43600 R15: 0000000000000007 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 9 [ffffbd13003d3808] ip6_pol_route at ffffffff8ddb030c 10 [ffffbd13003d3888] ip6_pol_route_input at ffffffff8ddb068c 11 [ffffbd13003d3898] fib6_rule_lookup at ffffffff8ddf02b5 12 [ffffbd13003d3928] ip6_route_input at ffffffff8ddb0f47 13 [ffffbd13003d3a18] ip6_rcv_finish_core.constprop.0 at ffffffff8dd950d0 14 [ffffbd13003d3a30] ip6_list_rcv_finish.constprop.0 at ffffffff8dd96274 15 [ffffbd13003d3a98] ip6_sublist_rcv at ffffffff8dd96474 16 [ffffbd13003d3af8] ipv6_list_rcv at ffffffff8dd96615 17 [ffffbd13003d3b60] __netif_receive_skb_list_core at ffffffff8dc16fec 18 [ffffbd13003d3be0] netif_receive_skb_list_internal at ffffffff8dc176b3 19 [ffffbd13003d3c50] napi_gro_receive at ffffffff8dc565b9 20 [ffffbd13003d3c80] ice_receive_skb at ffffffffc087e4f5 [ice] 21 [ffffbd13003d3c90] ice_clean_rx_irq at ffffffffc0881b80 [ice] 22 [ffffbd13003d3d20] ice_napi_poll at ffffffffc088232f [ice] 23 [ffffbd13003d3d80] __napi_poll at ffffffff8dc18000 24 [ffffbd13003d3db8] net_rx_action at ffffffff8dc18581 25 [ffffbd13003d3e40] __do_softirq at ffffffff8df352e9 26 [ffffbd13003d3eb0] run_ksoftirqd at ffffffff8ceffe47 27 [ffffbd13003d3ec0] smpboot_thread_fn at ffffffff8cf36a30 28 [ffffbd13003d3ee8] kthread at ffffffff8cf2b39f 29 [ffffbd13003d3f28] ret_from_fork at ffffffff8ce5fa64 30 [ffffbd13003d3f50] ret_from_fork_asm at ffffffff8ce03cbb The Linux kernel CVE team has assigned CVE-2024-56703 to this issue. Affected and fixed versions =========================== Issue introduced in 4.15 with commit 66f5d6ce53e665477d2a33e8f539d4fa4ca81c83 and fixed in 6.11.11 with commit 11edcd026012ac18acee0f1514db3ed1b160fc6f Issue introduced in 4.15 with commit 66f5d6ce53e665477d2a33e8f539d4fa4ca81c83 and fixed in 6.12.2 with commit 34a949e7a0869dfa31a40416d2a56973fae1807b Issue introduced in 4.15 with commit 66f5d6ce53e665477d2a33e8f539d4fa4ca81c83 and fixed in 6.13-rc1 with commit d9ccb18f83ea2bb654289b6ecf014fd267cc988b 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-56703 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_fib.c net/ipv6/route.c tools/testing/selftests/net/Makefile tools/testing/selftests/net/ipv6_route_update_soft_lockup.sh 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/11edcd026012ac18acee0f1514db3ed1b160fc6f https://git.kernel.org/stable/c/34a949e7a0869dfa31a40416d2a56973fae1807b https://git.kernel.org/stable/c/d9ccb18f83ea2bb654289b6ecf014fd267cc988b