Re: running get_user_pages() from kernel thread

From: Rik van Riel
Date: Tue Jun 16 2009 - 17:19:20 EST


Hugh Dickins wrote:

[PATCH] mm: pass mm to grab_swap_token

If a kthread happens to use get_user_pages() on an mm (as KSM does),
there's a chance that it will end up trying to read in a swap page,
then oops in grab_swap_token() because the kthread has no mm: GUP
passes down the right mm, so grab_swap_token() ought to be using it.

Signed-off-by: Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx>

Provided nobody has a problem with giving the swap token
to a task that isn't actually swapping itself ...

Acked-by: Rik van Riel <riel@xxxxxxxxxx>

(I don't have any strong opinions either way)

--
All rights reversed.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/