From 18dddc5e6b5439b61e7b411d46f96f8a2145295b Mon Sep 17 00:00:00 2001 From: zhong jiang Date: Thu, 23 May 2019 18:28:41 +0800 Subject: [PATCH] mm/mempolicy: Fix an incorrect rebind node in mpol_rebind_nodemask euler inclusion category: bugfix bugzilla: 16085 CVE: NA ------------------------------------------------- Commit 213980c0f23 ("mm, mempolicy: simplify rebinding mempolicies when updating cpusets") introduce an numa bind issue. when set the cpuset.mem_allowed, A process will rebind the specified policy more than one times. if the cpuset_mems_allowed is not equal to user specified nodes. it will result in the wrong policy which allocating much memory from wrong node. Fixes: 213980c0f23 ("mm, mempolicy: simplify rebinding mempolicies when updating cpusets") Signed-off-by: zhong jiang Reviewed-by: Wei Yongjun Signed-off-by: Yang Yingliang --- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index c73ae1f9175b..2f0744f2e19f 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -345,7 +345,7 @@ static void mpol_rebind_nodemask(struct mempolicy *pol, const nodemask_t *nodes) else { nodes_remap(tmp, pol->v.nodes,pol->w.cpuset_mems_allowed, *nodes); - pol->w.cpuset_mems_allowed = tmp; + pol->w.cpuset_mems_allowed = *nodes; } if (nodes_empty(tmp)) -- GitLab