fix cve-2008-1367-x86-clear-DF-before-calling-signal-handler.patch
[linux-2.6.22.y-op-patches.git] / queue-2.6.22.y / grab-swap-token-oops.patch
blob7f4df121832353143c2fa9ba705d14726c11c5bd
1 From: Dean Roe <roe@sgi.com>
2 Subject: Prevent NULL pointer deref in grab_swap_token
3 References: 159260
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>
16 mm/thrash.c | 3 +++
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)
22 int current_interval;
24 global_faults++;
25 + if (current->mm == NULL)
26 + return;
29 current_interval = global_faults - current->mm->faultstamp;