projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
futex: Prevent attaching to kernel threads
[firefly-linux-kernel-4.4.55.git]
/
kernel
/
futex.c
diff --git
a/kernel/futex.c
b/kernel/futex.c
index 7c68225e3967c075d943b179c276056cdb807dbc..81dbe773ce4c20bdeafa8effa858cf85b995dfbe 100644
(file)
--- a/
kernel/futex.c
+++ b/
kernel/futex.c
@@
-814,6
+814,11
@@
lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
if (!p)
return -ESRCH;
+ if (!p->mm) {
+ put_task_struct(p);
+ return -EPERM;
+ }
+
/*
* We need to look at the task state flags to figure out,
* whether the task is exiting. To protect against the do_exit