Skip to content
Snippets Groups Projects
Commit 1fbc8ee5 authored by Ma Wupeng's avatar Ma Wupeng Committed by Yongqiang Liu
Browse files

mm: Update reliable flag in memory allocaion for reliable task only in task context

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S


CVE: NA

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

Since interrupt may occupy reliable task's context and its current->flags
will have PF_RELIABLE and this will lead to redirect it's memory allocation
to mirrored region.

Update reliable task's gfp flag can only happen in normal task context by
checking in_task().

Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 857d0cd5
No related branches found
No related tags found
No related merge requests found
......@@ -4625,6 +4625,9 @@ static inline void prepare_before_alloc(gfp_t *gfp_mask)
return;
}
if (!in_task())
return;
if (is_global_init(current) || (current->flags & PF_RELIABLE))
*gfp_mask |= ___GFP_RELIABILITY;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment