# smb:在 close_all_cached_dirs 失败时记录错误
## 漏洞概述
在Linux内核中,当内存不足时,`close_all_cached_dirs()`函数无法将dentries移动到单独的列表并`dput()`它们,这会导致“Dentry仍然在使用中”的错误。这个漏洞已通过日志记录错误信息并处理内存分配失败来解决。
## 影响版本
未提供具体影响版本信息。
## 细节
- 当系统内存不足时,`close_all_cached_dirs()`函数无法将dentries移动到单独的列表,以便在释放锁后 `dput()` 它们。
- 这种情况会导致“Dentry仍然在使用中”的错误,并在系统日志中记录错误信息。
- 如果一次内存分配失败,该函数会立即退出循环,不再继续处理其他 tcons,因为后续的 `kmalloc()` 调用很可能也会失败。
## 影响
- 导致“Dentry仍然在使用中”的错误。
- 系统日志中会显示错误信息:
```
[ 495.281119] CIFS: VFS: \\otters.example.com\share Out of memory while dropping dentries
[ 495.281595] ------------[ cut here ]------------
[ 495.281887] BUG: Dentry ffff888115531138{i=78,n=/} still in use (2) [unmount of cifs cifs]
[ 495.282391] WARNING: CPU: 1 PID: 2329 at fs/dcache.c:1536 umount_check+0xc8/0xf0
```
# | POC 描述 | 源链接 | 神龙链接 |
---|
标题: smb: Log an error when close_all_cached_dirs fails - kernel/git/stable/linux.git - Linux kernel stable tree -- 🔗来源链接
标签:
神龙速读