【严重程度】 一般
【特性】 文件系统
【重现类型】 有条件必然重现
【* 定位分析】 (备注: 有效问题请“先对原有功能进行描述,重点描述与当前故障现象相关的技术点、以及缺陷出现的触发条件、错误出现的函数等”;非问题“需要澄清技术细节,描述技术实现原理以及当前现象合理性的解释”;重复问题请“说明重复问题单号”blk_trace_ioctl
__blk_trace_remove
346 static int __blk_trace_remove(struct request_queue q)
/ [previous][next][first][last][top][bottom][index][help] /
347 {
348 struct blk_trace bt;
349
350 bt = rcu_replace_pointer(q->blk_trace, NULL,
351 lockdep_is_held(&q->debugfs_mutex));
352 if (!bt)
353 return -EINVAL;
354
355 if (bt->trace_state != Blktrace_running)
356 blk_trace_cleanup(bt);
357
358 return 0;
359 }
可以看到如果block trace是Blktrace_running状态,那么__blk_trace_remove只会把q->blk_trace置空,但是并不会去调用blk_trace_cleanup做清理。
再来看看如果设备被删除时队列清理的流程
blk_release_queue
blk_trace_shutdown(q); -> 这里blk_trace已经是空了不会做任何动作
debugfs_remove_recursive(q->debugfs_dir); -> 这里会递归删除debugfs的所有文件
因为在创建流程中relay_open并没有额外持有创建出来文件的dentry的引用的计数,那么dentry就会随着队列清理的时候debugfs_remove_recursive(q->debugfs_dir) 递归删除的时引用计数降到零,导致dentry->d_inode是空的。
由于这个时候blk_trace还是在running_trace_list上,所以在trace_note_tsk流程里还是是可以遍历到该节点。
trace_note_tsk
trace_note
relay_reserve
relay_switch_subbuf
d_inode(buf->dentry)->i_size -> 触发空指针引用。
【 影响评估及测试建议】
出现内存泄漏或者出现空指针引用
【 对外影响描述】有
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: @YangYingliang , @成坚 (CHENG Jian) , @jiaoff , @zhengzengkai , @刘勇强 , @wangxiongfeng , @朱科潜 , @WangShaoBo , @lujialin , @wuxu_buque , @Xu Kuohai , @冷嘲啊 , @Lingmingqiang , @yuzenghui , @juntian , @OSSIM , @陈结松 , @whoisxxx , @koulihong , @刘恺 , @hanjun-guo , @woqidaideshi , @Chiqijun , @Kefeng , @ThunderTown , @AlexGuo , @kylin-mayukun , @Zheng Zucheng , @柳歆 , @Jackie Liu , @zhujianwei001 , @郑振鹏 , @SuperSix173 , @colyli , @Zhang Yi , @htforge , @Qiuuuuu , @Yuehaibing , @xiehaocheng , @guzitao , @CTC-Xibo.Wang , @zhanghongchen , @chen wei , @Jason Zeng , @Xie XiuQi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论