projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
34006e1
)
Staging: android: lowmemorykiller: fix possible android low memory killer NULL pointer
author
David Rientjes
<
[email protected]
>
Mon, 11 May 2009 22:45:14 +0000
(15:45 -0700)
committer
Greg Kroah-Hartman
<
[email protected]
>
Fri, 19 Jun 2009 18:00:52 +0000
(11:00 -0700)
get_mm_rss() atomically dereferences the actual without checking for a
NULL pointer, which is possible since task_lock() is not held.
Cc: San Mehat <
[email protected]
>
Cc: Arve Hjønnevåg <
[email protected]
>
Signed-off-by: David Rientjes <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/staging/android/lowmemorykiller.c
patch
|
blob
|
history
diff --git
a/drivers/staging/android/lowmemorykiller.c
b/drivers/staging/android/lowmemorykiller.c
index f61333b96025f142672367750219e428ebbae32d..cba3b91d728ee933a088320f51c2e5de3ec04f1e 100644
(file)
--- a/
drivers/staging/android/lowmemorykiller.c
+++ b/
drivers/staging/android/lowmemorykiller.c
@@
-92,12
+92,18
@@
static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
for_each_process(p) {
int oom_adj;
- if (!p->mm)
+ task_lock(p);
+ if (!p->mm) {
+ task_unlock(p);
continue;
+ }
oom_adj = p->oomkilladj;
- if (oom_adj < min_adj)
+ if (oom_adj < min_adj) {
+ task_unlock(p);
continue;
+ }
tasksize = get_mm_rss(p->mm);
+ task_unlock(p);
if (tasksize <= 0)
continue;
if (selected) {