提交 36063a75 编写于 作者: G Gou Hao 提交者: Zheng Zengkai

eulerfs: fix potential sbi->persisters free error

uniontech inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I40JRR
CVE: NA

-------------------

After alloc the sbi->persisters memory, dep_init
will call dep_fini when error happened.Because
sbi->persisters is not set to 0, -> dep_fini()
can be called with sbi->persisters[] uninitialized,
thus kthread_stop() can be called with random value.
Signed-off-by: NGou Hao <gouhao@uniontech.com>
Reviewed-by: NYu Kuai <yukuai3@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a7b61394
...@@ -718,7 +718,7 @@ int dep_init(struct super_block *sb) ...@@ -718,7 +718,7 @@ int dep_init(struct super_block *sb)
for_each_possible_cpu(cpu) for_each_possible_cpu(cpu)
init_llist_head(per_cpu_ptr(sbi->persistee_list, cpu)); init_llist_head(per_cpu_ptr(sbi->persistee_list, cpu));
sbi->persisters = kmalloc(sizeof(struct task_struct *) * sbi->persisters = kzalloc(sizeof(struct task_struct *) *
persisters_per_socket * num_sockets, persisters_per_socket * num_sockets,
GFP_KERNEL); GFP_KERNEL);
if (!sbi->persisters) { if (!sbi->persisters) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册