# ftrace:在索引为 0 时修复 lookup_rec() 中的无效地址访问问题
## 漏洞概述
在Linux内核中修复了一个在`lookup_rec()`函数中当索引为0时发生无效地址访问的漏洞。该漏洞导致使用已释放的内存(use-after-free)问题。
## 影响版本
未具体说明受影响版本,但适用于包含相关代码的Linux内核版本。
## 细节
KASAN(Kernel Address Sanitizer)报告了如下问题:
```
BUG: KASAN: use-after-free in lookup_rec
Read of size 8 at addr ffff000199270ff0 by task modprobe
CPU: 2 Comm: modprobe
Call trace:
kasan_report
__asan_load8
lookup_rec
ftrace_location
arch_check_ftrace_location
check_kprobe_address_safe
register_kprobe
```
问题发生在`lookup_rec()`函数中访问`pg->records[pg->index - 1].ip`时。当`pg->index`为0时,索引变为`-1`,进而访问了无效地址`pg->records[-1].ip`。
## 影响
当`pg->index`为0时,访问数组负索引导致使用已释放的内存问题。修正措施是在`pg->index`为0时不检查`ip`。
# | POC 描述 | 源链接 | 神龙链接 |
---|
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签: