CVE-2026-64347 in Linux信息

摘要

由 VulDB • 2026-07-25

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

usb: gadget: composite: 修复 USB_DT_OTG 处理程序中的无效空值检查

composite_setup() 的 OTG 分支在未选择任何配置时会回退到第一个配置:

if (cdev->config) config = cdev->config; else config = list_first_entry(&cdev->configs, struct usb_configuration, list); if (!config) goto done; ... memcpy(req->buf, config->descriptors[0], value);

list_first_entry() 永远不会返回 NULL。在空列表上,它返回包含链表头的 container_of() 结果。因此,“if (!config)”检查是无效的(dead code)。

当 cdev->configs 为空时,config 指向 struct usb_composite_dev 内部的头部结构体。对 config->descriptors[0] 的读取会获取该偏移处的任意数据。memcpy 会将其中最多 w_length 字节复制到响应缓冲区中。

cdev->configs 在两种情况下可能为空:一种是在 gadget unbind 时,存在正在进行的控制传输导致的拆卸竞态条件;另一种是驱动程序在添加配置之前设置了 is_otg。一个保持 cdev->configs 为空的复现程序会在此分支触发 KASAN 错误。

使用 list_first_entry_or_null(),以便使现有的检查能够正常发挥作用。

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

来源

Want to stay up to date on a daily basis?

Enable the mail alert feature now!