]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/grab-swap-token-oops
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / grab-swap-token-oops
CommitLineData
00e5a55c
BS
1From: Dean Roe <roe@sgi.com>
2Subject: Prevent NULL pointer deref in grab_swap_token
3References: 159260
4
5grab_swap_token() assumes that the current process has an mm struct,
6which is not true for kernel threads invoking get_user_pages(). Since
7this should be extremely rare, just return from grab_swap_token()
8without doing anything.
9
10Signed-off-by: Dean Roe <roe@sgi.com>
11Acked-by: mason@suse.de
12Acked-by: okir@suse.de
13
14
15 mm/thrash.c | 3 +++
16 1 file changed, 3 insertions(+)
17
18--- a/mm/thrash.c
19+++ b/mm/thrash.c
20@@ -31,6 +31,9 @@ void grab_swap_token(void)
21 int current_interval;
22
23 global_faults++;
24+ if (current->mm == NULL)
25+ return;
26+
27
28 current_interval = global_faults - current->mm->faultstamp;
29