# 网络:lan966x:修复lan966x_stats_init()中潜在的空指针解引用问题
## 概述
在Linux内核中,lan966x_stats_init() 函数调用了 `create_singlethread_workqueue()`,但未检查返回值,这可能导致空指针解引用错误。
## 细节
`lan966x_stats_init()` 调用 `create_singlethread_workqueue()` 而没有检查其返回值,因此可能会返回NULL。随后调用 `queue_delayed_work()` 时,可能导致空指针解引用:
```plaintext
lan966x_stats_init()
create_singlethread_workqueue() # 失败,lan966x->stats_queue 为 NULL
queue_delayed_work()
queue_delayed_work_on()
__queue_delayed_work() # 这里有警告,但仍继续
__queue_work() # 访问 wq->flags,导致空指针解引用
```
解决方法是检查返回值,如果返回值为NULL,则返回 -ENOMEM。
## 影响
该漏洞可能导致系统崩溃或不稳定。
# | POC 描述 | 源链接 | 神龙链接 |
---|
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签: