From: Ma Wupeng mawupeng1@huawei.com
hulk inclusion category: feature 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.
In order to solve this problem, update reliable task's gfp flag can only happen in normal task context by checking in_task().
Signed-off-by: Ma Wupeng mawupeng1@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com --- mm/page_alloc.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5fdbe4ecfb58..24116b7828f5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5182,6 +5182,9 @@ static inline void prepare_before_alloc(gfp_t *gfp_mask) if (!zone_movable) goto clear_flag;
+ if (!in_task()) + return; + if ((current->flags & PF_RELIABLE) || is_global_init(current)) *gfp_mask |= GFP_RELIABLE;