CVE-2025-38719: net: hibmcge: fix the division by zero issue
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net: hibmcge: fix the division by zero issue
When the network port is down, the queue is released, and ring->len is 0. In debugfs, hbg_get_queue_used_num() will be called,
which may lead to a division by zero issue.
This patch adds a check, if ring->len is 0,hbg_get_queue_used_num() directly returns 0.
The Linux kernel CVE team has assigned CVE-2025-38719 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.13 with commit 40735e7543f94fc88f58d94fd5f88daa4a2f2c6e and fixed in 6.15.11 with commit c945e1ad4f3b77166a3215dabc0c6c980d4a9c73 Issue introduced in 6.13 with commit 40735e7543f94fc88f58d94fd5f88daa4a2f2c6e and fixed in 6.16.2 with commit 475e06113c615dafd44262d6d6bd37786f7f4206 Issue introduced in 6.13 with commit 40735e7543f94fc88f58d94fd5f88daa4a2f2c6e and fixed in 6.17-rc2 with commit 7004b26f0b64331143eb0b312e77a357a11427ce
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-38719
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/hisilicon/hibmcge/hbg_txrx.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/c945e1ad4f3b77166a3215dabc0c6c980d4a9c73 https://git.kernel.org/stable/c/475e06113c615dafd44262d6d6bd37786f7f4206 https://git.kernel.org/stable/c/7004b26f0b64331143eb0b312e77a357a11427ce