Prev: [27/45] ext4: Avoid null pointer dereference when decoding EROFS w/o a journal
Next: [23/45] USB: usbfs: only copy the actual data received
From: Greg KH on 30 Mar 2010 20:40 2.6.31-stable review patch. If anyone has any objections, please let us know. ------------------ From: Linus Torvalds <torvalds(a)linux-foundation.org> commit 6f5a55f1a6c5abee15a0e878e5c74d9f1569b8b0 upstream. We incorrectly depended on the 'node_state/node_isset()' functions testing the node range, rather than checking it explicitly. That's not reliable, even if it might often happen to work. So do the proper explicit test. Reported-by: Marcus Meissner <meissner(a)suse.de> Acked-and-tested-by: Brice Goglin <Brice.Goglin(a)inria.fr> Acked-by: Hugh Dickins <hugh.dickins(a)tiscali.co.uk> Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de> --- mm/migrate.c | 3 +++ 1 file changed, 3 insertions(+) --- a/mm/migrate.c +++ b/mm/migrate.c @@ -937,6 +937,9 @@ static int do_pages_move(struct mm_struc goto out_pm; err = -ENODEV; + if (node < 0 || node >= MAX_NUMNODES) + goto out_pm; + if (!node_state(node, N_HIGH_MEMORY)) goto out_pm; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |