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 6C03B2ED86A for ; Fri, 25 Jul 2025 15:29:32 +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=1753457372; cv=none; b=r60141YRIq9RT0Z8y6OqAyBEqqkevuweni0FV9/kPRJBWQ3zc99wcrQmMAPxmSjJBorQqpsGROLnWJRmPPZgsaV1fxyz+KaC9bQSc7vOEDQYcReo92498yQHgrGSfW/onrnTzRb4bfbqUA7svU85f0omXaG2dkX/yiQzK8ZeZeI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753457372; c=relaxed/simple; bh=++Q/2gQhqBtl+zlnzCX2OYAyfocStiNbawH2lYZPRXg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gy90gx+l/ytjwrRmFoM2hdtovtPInuNke7zF+UWMie/HiefLtSyh7UkCaLtIsGxdJtfyAYBfuzAIcEjaAChQlAIXuDM9LCxaGBbkZ6F6X5VIJ1P26vrVwR5n0aiuyG4Eive0D//LAjHoPOHqVe5u4Rvy17grVDnGbwF8gQp7hnE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q5/+ScRF; 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="Q5/+ScRF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF973C4CEE7; Fri, 25 Jul 2025 15:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753457372; bh=++Q/2gQhqBtl+zlnzCX2OYAyfocStiNbawH2lYZPRXg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Q5/+ScRFEHyk+33EwrTosNsRpdAGD1Xa0c0oZGqypYlzvMWzrq26BkYk/D2GEf+lR jQpiT5b9Stl6Qsrl3lUN8LnZCvivDjAY2EbmOyIuHwcbgCcFeDLdOyieW/TOT7o+Xx XKqLT2ILQCwCqbmc4jyg7xqziM6MhuSGX+gvNiDM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38440: net/mlx5e: Fix race between DIM disable and net_dim() Date: Fri, 25 Jul 2025 17:28:02 +0200 Message-ID: <2025072501-CVE-2025-38440-cb71@gregkh> X-Mailer: git-send-email 2.50.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=3759; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ODKi+/MzjAwvbzYOiCIwctk51kkkC+3QAAIC4mS3XO0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnNi5p23lf55yW7/eSS72k1xrfaJrsecXWMEY3w07Diy C0JddXtiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIkUxDAsmDr3+52VebN2rPrD /8r7otrHiZMu6DHM4QhLnaC4T/T3+YZrnxdymezxnn/0DAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: net/mlx5e: Fix race between DIM disable and net_dim() There's a race between disabling DIM and NAPI callbacks using the dim pointer on the RQ or SQ. If NAPI checks the DIM state bit and sees it still set, it assumes `rq->dim` or `sq->dim` is valid. But if DIM gets disabled right after that check, the pointer might already be set to NULL, leading to a NULL pointer dereference in net_dim(). Fix this by calling `synchronize_net()` before freeing the DIM context. This ensures all in-progress NAPI callbacks are finished before the pointer is cleared. Kernel log: BUG: kernel NULL pointer dereference, address: 0000000000000000 ... RIP: 0010:net_dim+0x23/0x190 ... Call Trace: ? __die+0x20/0x60 ? page_fault_oops+0x150/0x3e0 ? common_interrupt+0xf/0xa0 ? sysvec_call_function_single+0xb/0x90 ? exc_page_fault+0x74/0x130 ? asm_exc_page_fault+0x22/0x30 ? net_dim+0x23/0x190 ? mlx5e_poll_ico_cq+0x41/0x6f0 [mlx5_core] ? sysvec_apic_timer_interrupt+0xb/0x90 mlx5e_handle_rx_dim+0x92/0xd0 [mlx5_core] mlx5e_napi_poll+0x2cd/0xac0 [mlx5_core] ? mlx5e_poll_ico_cq+0xe5/0x6f0 [mlx5_core] busy_poll_stop+0xa2/0x200 ? mlx5e_napi_poll+0x1d9/0xac0 [mlx5_core] ? mlx5e_trigger_irq+0x130/0x130 [mlx5_core] __napi_busy_loop+0x345/0x3b0 ? sysvec_call_function_single+0xb/0x90 ? asm_sysvec_call_function_single+0x16/0x20 ? sysvec_apic_timer_interrupt+0xb/0x90 ? pcpu_free_area+0x1e4/0x2e0 napi_busy_loop+0x11/0x20 xsk_recvmsg+0x10c/0x130 sock_recvmsg+0x44/0x70 __sys_recvfrom+0xbc/0x130 ? __schedule+0x398/0x890 __x64_sys_recvfrom+0x20/0x30 do_syscall_64+0x4c/0x100 entry_SYSCALL_64_after_hwframe+0x4b/0x53 ... ---[ end trace 0000000000000000 ]--- ... ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- The Linux kernel CVE team has assigned CVE-2025-38440 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 445a25f6e1a2f6a132b06af6ede4f3c9b5f9af68 and fixed in 6.12.39 with commit 7581afc051542e11ccf3ade68acd01b7fb1a3cde Issue introduced in 6.10 with commit 445a25f6e1a2f6a132b06af6ede4f3c9b5f9af68 and fixed in 6.15.7 with commit 2bc6fb90486e42dd80e660ef7a40c02b2516c6d6 Issue introduced in 6.10 with commit 445a25f6e1a2f6a132b06af6ede4f3c9b5f9af68 and fixed in 6.16-rc6 with commit eb41a264a3a576dc040ee37c3d9d6b7e2d9be968 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-2025-38440 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/mellanox/mlx5/core/en_dim.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/7581afc051542e11ccf3ade68acd01b7fb1a3cde https://git.kernel.org/stable/c/2bc6fb90486e42dd80e660ef7a40c02b2516c6d6 https://git.kernel.org/stable/c/eb41a264a3a576dc040ee37c3d9d6b7e2d9be968