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 DF9DF190670 for ; Tue, 30 Jul 2024 07:50:52 +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=1722325853; cv=none; b=bjsBM59YNEa6UBfMmvdn6mSfKmXcg9Sh+HV69fJ/KuTVni3GZ63eqjcha4bo1zOe4fo+JzIbyo5d5mHKOnk1P3jzF+t7nj551xJUwfDB1yD+lslQggiT2WBXCzwkoON/HeWmB0z2kWDNwmatj5b0sAy2v0S+vdVTfbCr5okiIk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722325853; c=relaxed/simple; bh=yUykVzZ153x8FzhhjWhe9GoBkpc5rU0JujuLgA93AQo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Bn+RAKqzGvtMNunVbNpPhOY9Z1DSCbiRrvCDkYZIbwjh4l4UadzbFKXILhvlhoanpYqH+25Ui9QhLDxNuyZD0sr9fJbeBZqwKgFOsO/gf0Wbmjs5tldC+cnlyBu+ddZIFglfvUGq6a/iKTVkL9hDzzvqIMxnnd2R1RCPy/nM68g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=g4qccoqQ; 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="g4qccoqQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14C65C32782; Tue, 30 Jul 2024 07:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722325852; bh=yUykVzZ153x8FzhhjWhe9GoBkpc5rU0JujuLgA93AQo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=g4qccoqQW6tRUYb72TAaQQL5J6BSXdt9UzucarEZmj6ZU9+SeqtPuDAI8CedKfZb8 mc/AT/2Z9AzUWGKQ4caz0P6Ni2MpGk21/ohvpYjx5EDGe4SHAW+EUxkhp7r2hXxcE4 UND3bb1WQ0HyMxgS4PvdTQelApROj6lxtdhJ1KSQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-42110: net: ntb_netdev: Move ntb_netdev_rx_handler() to call netif_rx() from __netif_rx() Date: Tue, 30 Jul 2024 09:47:28 +0200 Message-ID: <2024073021-CVE-2024-42110-4b28@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=4171; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=yUykVzZ153x8FzhhjWhe9GoBkpc5rU0JujuLgA93AQo=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkrZnXuPnDkFeOXKJ/lpmoXuvQmT/lwV+fx7OU+ubFWq U/XMTIldsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEMo4yzGK+sC9VotT+25nv n+8+dJDKqDd7ysswz4T9OculxkVFUw583qv+ecLj1UsrHwIA 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: net: ntb_netdev: Move ntb_netdev_rx_handler() to call netif_rx() from __netif_rx() The following is emitted when using idxd (DSA) dmanegine as the data mover for ntb_transport that ntb_netdev uses. [74412.546922] BUG: using smp_processor_id() in preemptible [00000000] code: irq/52-idxd-por/14526 [74412.556784] caller is netif_rx_internal+0x42/0x130 [74412.562282] CPU: 6 PID: 14526 Comm: irq/52-idxd-por Not tainted 6.9.5 #5 [74412.569870] Hardware name: Intel Corporation ArcherCity/ArcherCity, BIOS EGSDCRB1.E9I.1752.P05.2402080856 02/08/2024 [74412.581699] Call Trace: [74412.584514] [74412.586933] dump_stack_lvl+0x55/0x70 [74412.591129] check_preemption_disabled+0xc8/0xf0 [74412.596374] netif_rx_internal+0x42/0x130 [74412.600957] __netif_rx+0x20/0xd0 [74412.604743] ntb_netdev_rx_handler+0x66/0x150 [ntb_netdev] [74412.610985] ntb_complete_rxc+0xed/0x140 [ntb_transport] [74412.617010] ntb_rx_copy_callback+0x53/0x80 [ntb_transport] [74412.623332] idxd_dma_complete_txd+0xe3/0x160 [idxd] [74412.628963] idxd_wq_thread+0x1a6/0x2b0 [idxd] [74412.634046] irq_thread_fn+0x21/0x60 [74412.638134] ? irq_thread+0xa8/0x290 [74412.642218] irq_thread+0x1a0/0x290 [74412.646212] ? __pfx_irq_thread_fn+0x10/0x10 [74412.651071] ? __pfx_irq_thread_dtor+0x10/0x10 [74412.656117] ? __pfx_irq_thread+0x10/0x10 [74412.660686] kthread+0x100/0x130 [74412.664384] ? __pfx_kthread+0x10/0x10 [74412.668639] ret_from_fork+0x31/0x50 [74412.672716] ? __pfx_kthread+0x10/0x10 [74412.676978] ret_from_fork_asm+0x1a/0x30 [74412.681457] The cause is due to the idxd driver interrupt completion handler uses threaded interrupt and the threaded handler is not hard or soft interrupt context. However __netif_rx() can only be called from interrupt context. Change the call to netif_rx() in order to allow completion via normal context for dmaengine drivers that utilize threaded irq handling. While the following commit changed from netif_rx() to __netif_rx(), baebdf48c360 ("net: dev: Makes sure netif_rx() can be invoked in any context."), the change should've been a noop instead. However, the code precedes this fix should've been using netif_rx_ni() or netif_rx_any_context(). The Linux kernel CVE team has assigned CVE-2024-42110 to this issue. Affected and fixed versions =========================== Issue introduced in 3.9 with commit 548c237c0a99 and fixed in 6.1.98 with commit 4b3b6c7efee6 Issue introduced in 3.9 with commit 548c237c0a99 and fixed in 6.6.39 with commit e3af5b14e763 Issue introduced in 3.9 with commit 548c237c0a99 and fixed in 6.9.9 with commit 858ae09f0367 Issue introduced in 3.9 with commit 548c237c0a99 and fixed in 6.10 with commit e15a5d821e51 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-42110 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/ntb_netdev.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/4b3b6c7efee69f077b86ef7f088fb96768e46e1f https://git.kernel.org/stable/c/e3af5b14e7632bf12058533d69055393e2d126c9 https://git.kernel.org/stable/c/858ae09f03677a4ab907a15516893bc2cc79d4c3 https://git.kernel.org/stable/c/e15a5d821e5192a3769d846079bc9aa380139baf