402 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

【OLK-5.10】当前版本添加块设备没有错误处理,添加块设备错误时会导致内核panic

已完成
任务
创建于  
2023-09-16 20:21

【严重程度】 一般
【特性】 block驱动/block
【重现类型】 有条件必然重现
【定位分析】


当前驱动没有对创建设备失败时进行错误处理,导致在add_dsik失败时驱动无法感知,导致驱动在使用或者删除时会造成空指针引用,导致内核panic,

一个典型的例子是:

调用栈是:

删除设备时空指针引用
del_gendisk
device_del
kill_device
if (dev->p->dead) ->空指针引用

创建块设备时分配失败
查看 dev->p 何时分配的
device_add_disk
__device_add_disk
register_disk
device_add
device_private_init
dev->p = kzalloc ->分配失败

相关bugzilla: http://openeuler.huawei.com/bugzilla/show_bug.cgi?id=188162


评论 (1)

Hi zhixiuzhou, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers.

hulk-robot 创建了任务
openeuler-ci-bot 添加了
 
sig/Kernel
标签
ci-robot 通过openeuler/kernel Pull Request !2825任务状态待办的 修改为已完成
展开全部操作日志

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5329419 openeuler ci bot 1632792936
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助