• 公告ID (KylinSec-SA-2025-2410)

摘要:

In the Linux kernel, the following vulnerability has been resolved:

idpf: fix adapter NULL pointer dereference on reboot

With SRIOV enabled, idpf ends up calling into idpf_remove() twice.
First via idpf_shutdown() and then again when idpf_remove() calls into
sriov_disable(), because the VF devices use the idpf driver, hence the
same remove routine. When that happens, it is possible for the adapter
to be NULL from the first call to idpf_remove(), leading to a NULL
pointer dereference.

echo 1 &gt; /sys/class/net/<netif&gt;/device/sriov_numvfs
reboot

BUG: kernel NULL pointer dereference, address: 0000000000000020
...
RIP: 0010:idpf_remove+0x22/0x1f0 [idpf]
...
? idpf_remove+0x22/0x1f0 [idpf]
? idpf_remove+0x1e4/0x1f0 [idpf]
pci_device_remove+0x3f/0xb0
device_release_driver_internal+0x19f/0x200
pci_stop_bus_device+0x6d/0x90
pci_stop_and_remove_bus_device+0x12/0x20
pci_iov_remove_virtfn+0xbe/0x120
sriov_disable+0x34/0xe0
idpf_sriov_configure+0x58/0x140 [idpf]
idpf_remove+0x1b9/0x1f0 [idpf]
idpf_shutdown+0x12/0x30 [idpf]
pci_device_shutdown+0x35/0x60
device_shutdown+0x156/0x200
...

Replace the direct idpf_remove() call in idpf_shutdown() with
idpf_vc_core_deinit() and idpf_deinit_dflt_mbx(), which perform
the bulk of the cleanup, such as stopping the init task, freeing IRQs,
destroying the vports and freeing the mailbox. This avoids the calls to
sriov_disable() in addition to a small netdev cleanup, and destroying
workqueues, which don't seem to be required on shutdown.

安全等级: Low

公告ID: KylinSec-SA-2025-2410

发布日期: 2025年6月3日

关联CVE: CVE-2025-22065  

  • 详细介绍

1. 漏洞描述

   

在Linux内核中,以下漏洞已修复:

idpf:修复重启时适配器空指针解引用问题

当启用SRIOV时,idpf会两次调用idpf_remove()函数。第一次通过idpf_shutdown()调用,第二次是在idpf_remove()调用sriov_disable()时触发(因为VF设备使用idpf驱动,因此调用相同的移除例程)。此时,首次idpf_remove()调用可能导致适配器变为空指针,从而引发空指针解引用。

复现步骤:
echo 1 > /sys/class/net//device/sriov_numvfs
reboot

漏洞现象:
BUG: 内核空指针解引用,地址:0000000000000020
...
RIP: 0010:idpf_remove+0x22/0x1f0 [idpf]
...
调用栈轨迹显示重复的idpf_remove调用链:
? idpf_remove+0x22/0x1f0 [idpf]
? idpf_remove+0x1e4/0x1f0 [idpf]
pci_device_remove+0x3f/0xb0
...

修复方案:
将idpf_shutdown()中直接调用idpf_remove()替换为:

idpf_vc_core_deinit() - 执行核心组件反初始化
idpf_deinit_dflt_mbx() - 执行默认邮箱反初始化
这两个新函数完成主要清理工作:

停止初始化任务
释放中断请求(IRQ)
销毁虚拟端口(vports)
释放邮箱资源
改进效果:

避免重复调用sriov_disable()
精简网络设备清理流程
取消关机时非必要的工作队列销毁操作
该修复通过分离核心清理逻辑与SRIOV特定操作,解决了双重调用导致的空指针问题,同时优化了关机流程的资源管理。

2. 影响范围

cve名称 产品 组件 是否受影响
CVE-2025-22065 KY3.4-5A kernel Unaffected
CVE-2025-22065 V6 kernel Unaffected

3. 影响组件

    无

4. 修复版本

    无

5. 修复方法

   无

6. 下载链接

    无
上一篇:KylinSec-SA-2025-2404 下一篇:KylinSec-SA-2025-2437