]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PATCH] Fix sys_move_pages when a NULL node list is passed.
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Nov 2006 03:42:43 +0000 (14:42 +1100)
committerChris Wright <chrisw@sous-sol.org>
Sun, 19 Nov 2006 03:27:58 +0000 (19:27 -0800)
commitd8b789ca13e5bccc3167d0cfa6cec3ff4b541891
treefa0fb3a1ac247ca2c55de19e62489a96947a5b1e
parentfbce4d7fea4bd2a3e54be9c1c29440d5b4dfc600
[PATCH] Fix sys_move_pages when a NULL node list is passed.

sys_move_pages() uses vmalloc() to allocate an array of structures
that is fills with information passed from user mode and then passes to
do_stat_pages() (in the case the node list is NULL).  do_stat_pages()
depends on a marker in the node field of the structure to decide how large
the array is and this marker is correctly inserted into the last element
of the array.  However, vmalloc() doesn't zero the memory it allocates
and if the user passes NULL for the node list, then the node fields are
not filled in (except for the end marker).  If the memory the vmalloc()
returned happend to have a word with the marker value in it in just the
right place, do_pages_stat will fail to fill the status field of part
of the array and we will return (random) kernel data to user mode.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
mm/migrate.c