1 From: Dean Roe <roe@sgi.com>
2 Subject: Prevent NULL pointer deref in grab_swap_token
5 grab_swap_token() assumes that the current process has an mm struct,
6 which is not true for kernel threads invoking get_user_pages(). Since
7 this should be extremely rare, just return from grab_swap_token()
8 without doing anything.
10 Signed-off-by: Dean Roe <roe@sgi.com>
11 Acked-by: mason@suse.de
12 Acked-by: okir@suse.de
13 Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
17 1 file changed, 3 insertions(+)
19 --- a/mm/thrash.c 2007-07-08 19:32:17.000000000 -0400
20 +++ b/mm/thrash.c 2007-08-27 14:01:21.000000000 -0400
21 @@ -31,6 +31,9 @@ void grab_swap_token(void)
25 + if (current->mm == NULL)
29 current_interval = global_faults - current->mm->faultstamp;