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 134C61A8F63 for ; Thu, 27 Mar 2025 16:47:25 +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=1743094045; cv=none; b=sgKzqrojI0DHtUjdE/yVI5JzAPnGnONUYcH4T+MKk6mJXYHRJM5yEnMo2b0+QTGgmrvJ7iZJlAJMJLZA1ixVg6JTqVMBD7w5XaZhDIsD8f4UozM/M6w5TTK6cW+crbyYdHODqsD/PQto6X6jCUOIHqAPdcRIFaXZQ9piir765/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743094045; c=relaxed/simple; bh=BsZEJjGBPQz9KV7Rwb1RsDwdU+MHc8EBAD+jrkQLvTU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Wy4Mv+/UnBiSSotP5PGyRABkihj+mTQUu5Qp/qmQWoqpVlGhyn2JPFrg8azVOjgAGewvXPa4Nv4VcejTX24GWmEcvpd7/wgQTTcxIxut5HJBzBh5ca01xADGdJzlxF4C0cOE14bhHTJJNMRd2tRTXpg/CUHNbxE5GDIV2Z01jdU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SRverTRc; 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="SRverTRc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E1BFC4CEDD; Thu, 27 Mar 2025 16:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743094044; bh=BsZEJjGBPQz9KV7Rwb1RsDwdU+MHc8EBAD+jrkQLvTU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SRverTRc5ji9l0A7qDxDM3ka6zSH1tlHBJzBWmhNaf5IgEVvHSjiVX81eZBUi9tat L7E2n/jT4xdYY8uV39zw/wCY1jS8E8vF5bpZSMjG12jzSDlXe6K0pqkyS8NMunfB5m riHH0aOGiFgszC3OgSTWDQCFIZ1ujuCNY34wnrtk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53029: octeontx2-pf: Fix the use of GFP_KERNEL in atomic context on rt Date: Thu, 27 Mar 2025 17:44:16 +0100 Message-ID: <2025032720-CVE-2023-53029-a670@gregkh> X-Mailer: git-send-email 2.49.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=4596; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=BsZEJjGBPQz9KV7Rwb1RsDwdU+MHc8EBAD+jrkQLvTU=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlPGzQOiGV51Ahv5IqMNJY+Us9X0Lk8fLF4ykr3fvaj2 0x7xXd0xLIwCDIxyIopsnzZxnN0f8UhRS9D29Mwc1iZQIYwcHEKwEQ2BDAsmMcqvPFTW4X+NZHX h4qL+H3ymjNSGWYx6e6f+dZ+Is95rTqepgSWpqj07m0A 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: octeontx2-pf: Fix the use of GFP_KERNEL in atomic context on rt The commit 4af1b64f80fb ("octeontx2-pf: Fix lmtst ID used in aura free") uses the get/put_cpu() to protect the usage of percpu pointer in ->aura_freeptr() callback, but it also unnecessarily disable the preemption for the blockable memory allocation. The commit 87b93b678e95 ("octeontx2-pf: Avoid use of GFP_KERNEL in atomic context") tried to fix these sleep inside atomic warnings. But it only fix the one for the non-rt kernel. For the rt kernel, we still get the similar warnings like below. BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 3 locks held by swapper/0/1: #0: ffff800009fc5fe8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock+0x24/0x30 #1: ffff000100c276c0 (&mbox->lock){+.+.}-{3:3}, at: otx2_init_hw_resources+0x8c/0x3a4 #2: ffffffbfef6537e0 (&cpu_rcache->lock){+.+.}-{2:2}, at: alloc_iova_fast+0x1ac/0x2ac Preemption disabled at: [] otx2_rq_aura_pool_init+0x14c/0x284 CPU: 20 PID: 1 Comm: swapper/0 Tainted: G W 6.2.0-rc3-rt1-yocto-preempt-rt #1 Hardware name: Marvell OcteonTX CN96XX board (DT) Call trace: dump_backtrace.part.0+0xe8/0xf4 show_stack+0x20/0x30 dump_stack_lvl+0x9c/0xd8 dump_stack+0x18/0x34 __might_resched+0x188/0x224 rt_spin_lock+0x64/0x110 alloc_iova_fast+0x1ac/0x2ac iommu_dma_alloc_iova+0xd4/0x110 __iommu_dma_map+0x80/0x144 iommu_dma_map_page+0xe8/0x260 dma_map_page_attrs+0xb4/0xc0 __otx2_alloc_rbuf+0x90/0x150 otx2_rq_aura_pool_init+0x1c8/0x284 otx2_init_hw_resources+0xe4/0x3a4 otx2_open+0xf0/0x610 __dev_open+0x104/0x224 __dev_change_flags+0x1e4/0x274 dev_change_flags+0x2c/0x7c ic_open_devs+0x124/0x2f8 ip_auto_config+0x180/0x42c do_one_initcall+0x90/0x4dc do_basic_setup+0x10c/0x14c kernel_init_freeable+0x10c/0x13c kernel_init+0x2c/0x140 ret_from_fork+0x10/0x20 Of course, we can shuffle the get/put_cpu() to only wrap the invocation of ->aura_freeptr() as what commit 87b93b678e95 does. But there are only two ->aura_freeptr() callbacks, otx2_aura_freeptr() and cn10k_aura_freeptr(). There is no usage of perpcu variable in the otx2_aura_freeptr() at all, so the get/put_cpu() seems redundant to it. We can move the get/put_cpu() into the corresponding callback which really has the percpu variable usage and avoid the sprinkling of get/put_cpu() in several places. The Linux kernel CVE team has assigned CVE-2023-53029 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15.87 with commit 6ea5273c71dd2d07c0a2459594eb34bc087939f7 and fixed in 5.15.91 with commit 29e9c67bf3271067735c188e95cf3631ecd64d58 Issue introduced in 6.1.5 with commit 667ce030bdfb62a86266444b2c3fd6ab98b9df9b and fixed in 6.1.8 with commit 659518e013d6bd562bb0f1d2d9f99d0ac54720e2 Issue introduced in 6.0.19 with commit b754dc7c933dd9464223f64b10d33d68ab086cc6 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-2023-53029 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/ethernet/marvell/octeontx2/nic/otx2_common.c drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h 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/29e9c67bf3271067735c188e95cf3631ecd64d58 https://git.kernel.org/stable/c/659518e013d6bd562bb0f1d2d9f99d0ac54720e2 https://git.kernel.org/stable/c/55ba18dc62deff5910c0fa64486dea1ff20832ff