提交 0a82b3e9 编写于 作者: X Xia Fukun 提交者: openeuler-sync-bot

sched/topology: Fix exceptional memory access in sd_llc_free_all()

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6YJJQ
CVE: NA

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

The function sd_llc_free_all() will be called to release allocated
resources when space allocation for the scheduling domain
structure fails. However, this function did not check if sd
is a null pointer when releasing sdd resources, resulting in
an error: "Unable to handle kernel paging request at virtual
address".

Fix this issue by adding null pointer discrimination.

Fixes: 79bec4c6 ("sched/topology: Provide hooks to allocate data shared per LLC")
Signed-off-by: NXia Fukun <xiafukun@huawei.com>
Reviewed-by: Nsongping yu <yusongping@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
(cherry picked from commit d73bbd3f)
上级 e5ecbf78
......@@ -2140,7 +2140,7 @@ static void sd_llc_free_all(const struct cpumask *cpu_map)
for_each_sd_topology(tl) {
sdd = &tl->data;
if (!sdd)
if (!sdd || !sdd->sd)
continue;
for_each_cpu(j, cpu_map) {
sd = *per_cpu_ptr(sdd->sd, j);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册