diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-kprobes-initialize-before-using-a-hlist.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-kprobes-initialize-before-using-a-hlist.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-kprobes-initialize-before-using-a-hlist.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-kprobes-initialize-before-using-a-hlist.patch new file mode 100644 index 00000000..9311e08d --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-kprobes-initialize-before-using-a-hlist.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 4dbd29bd7e0b2a712370f8d0c25d025d996edbc1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ananth N Mavinakayanahalli <ananth@in.ibm.com> | ||
3 | Date: Fri, 20 Jan 2012 14:34:04 -0800 | ||
4 | Subject: [PATCH 123/130] kprobes: initialize before using a hlist | ||
5 | |||
6 | commit d496aab567e7e52b3e974c9192a5de6e77dce32c upstream. | ||
7 | |||
8 | Commit ef53d9c5e ("kprobes: improve kretprobe scalability with hashed | ||
9 | locking") introduced a bug where we can potentially leak | ||
10 | kretprobe_instances since we initialize a hlist head after having used | ||
11 | it. | ||
12 | |||
13 | Initialize the hlist head before using it. | ||
14 | |||
15 | Reported by: Jim Keniston <jkenisto@us.ibm.com> | ||
16 | Acked-by: Jim Keniston <jkenisto@us.ibm.com> | ||
17 | Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> | ||
18 | Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | ||
19 | Cc: Srinivasa D S <srinivasa@in.ibm.com> | ||
20 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
21 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
22 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | ||
23 | --- | ||
24 | kernel/kprobes.c | 2 +- | ||
25 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
26 | |||
27 | diff --git a/kernel/kprobes.c b/kernel/kprobes.c | ||
28 | index e5d8464..52fd049 100644 | ||
29 | --- a/kernel/kprobes.c | ||
30 | +++ b/kernel/kprobes.c | ||
31 | @@ -1077,6 +1077,7 @@ void __kprobes kprobe_flush_task(struct task_struct *tk) | ||
32 | /* Early boot. kretprobe_table_locks not yet initialized. */ | ||
33 | return; | ||
34 | |||
35 | + INIT_HLIST_HEAD(&empty_rp); | ||
36 | hash = hash_ptr(tk, KPROBE_HASH_BITS); | ||
37 | head = &kretprobe_inst_table[hash]; | ||
38 | kretprobe_table_lock(hash, &flags); | ||
39 | @@ -1085,7 +1086,6 @@ void __kprobes kprobe_flush_task(struct task_struct *tk) | ||
40 | recycle_rp_inst(ri, &empty_rp); | ||
41 | } | ||
42 | kretprobe_table_unlock(hash, &flags); | ||
43 | - INIT_HLIST_HEAD(&empty_rp); | ||
44 | hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { | ||
45 | hlist_del(&ri->hlist); | ||
46 | kfree(ri); | ||
47 | -- | ||
48 | 1.7.7.4 | ||
49 | |||