--- linux-2.5-test/mm/policy.c.orig 2004-04-01 13:07:06.000000000 -0800 +++ linux-2.5-test/mm/policy.c 2004-04-01 13:03:31.000000000 -0800 @@ -140,7 +140,7 @@ /* When the user specified more nodes than supported just check if the non supported part is all zero. */ if (nmask && nlongs > BITS_TO_LONGS(MAX_NUMNODES)) { - for (k = BITS_TO_LONGS(MAX_NUMNODES); k < nlongs; k++) { + for (k = nlongs - BITS_TO_LONGS(MAX_NUMNODES); k < nlongs; k++) { unsigned long t; if (get_user(t, nmask + k)) return -EFAULT;