Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commit8970a63

Browse files
Yisheng Xietorvalds
Yisheng Xie
authored andcommitted
mm/mempolicy.c: avoid use uninitialized preferred_node
Alexander reported a use of uninitialized memory in __mpol_equal(),which is caused by incorrect use of preferred_node.When mempolicy in mode MPOL_PREFERRED with flags MPOL_F_LOCAL, it usesnuma_node_id() instead of preferred_node, however, __mpol_equal() usespreferred_node without checking whether it is MPOL_F_LOCAL or not.[akpm@linux-foundation.org: slight comment tweak]Link:http://lkml.kernel.org/r/4ebee1c2-57f6-bcb8-0e2d-1833d1ee0bb7@huawei.comFixes:fc36b8d ("mempolicy: use MPOL_F_LOCAL to Indicate Preferred Local Policy")Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>Reported-by: Alexander Potapenko <glider@google.com>Tested-by: Alexander Potapenko <glider@google.com>Reviewed-by: Andrew Morton <akpm@linux-foundation.org>Cc: Dmitriy Vyukov <dvyukov@google.com>Cc: Vlastimil Babka <vbabka@suse.cz>Cc: Michal Hocko <mhocko@kernel.org>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent3215b9d commit8970a63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎mm/mempolicy.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,6 +2124,9 @@ bool __mpol_equal(struct mempolicy *a, struct mempolicy *b)
21242124
caseMPOL_INTERLEAVE:
21252125
return !!nodes_equal(a->v.nodes,b->v.nodes);
21262126
caseMPOL_PREFERRED:
2127+
/* a's ->flags is the same as b's */
2128+
if (a->flags&MPOL_F_LOCAL)
2129+
return true;
21272130
returna->v.preferred_node==b->v.preferred_node;
21282131
default:
21292132
BUG();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp