The patch titled Subject: kprobes: initialize before using a hlist has been added to the -mm tree. Its filename is kprobes-initialize-before-using-a-hlist.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Ananth N Mavinakayanahalli <ananth@xxxxxxxxxx> Subject: kprobes: initialize before using a hlist Commit ef53d9c5e ("kprobes: improve kretprobe scalability with hashed locking") introduced a bug where we can potentially leak kretprobe_instances since we initialize a hlist head after having used it. Initialize the hlist head before using it. Reported by: Jim Keniston <jkenisto@xxxxxxxxxx> Acked-by: Jim Keniston <jkenisto@xxxxxxxxxx> Signed-off-by: Ananth N Mavinakayanahalli <ananth@xxxxxxxxxx> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Cc: Srinivasa D S <srinivasa@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/kprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN kernel/kprobes.c~kprobes-initialize-before-using-a-hlist kernel/kprobes.c --- a/kernel/kprobes.c~kprobes-initialize-before-using-a-hlist +++ a/kernel/kprobes.c @@ -1077,6 +1077,7 @@ void __kprobes kprobe_flush_task(struct /* Early boot. kretprobe_table_locks not yet initialized. */ return; + INIT_HLIST_HEAD(&empty_rp); hash = hash_ptr(tk, KPROBE_HASH_BITS); head = &kretprobe_inst_table[hash]; kretprobe_table_lock(hash, &flags); @@ -1085,7 +1086,6 @@ void __kprobes kprobe_flush_task(struct recycle_rp_inst(ri, &empty_rp); } kretprobe_table_unlock(hash, &flags); - INIT_HLIST_HEAD(&empty_rp); hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { hlist_del(&ri->hlist); kfree(ri); _ Subject: Subject: kprobes: initialize before using a hlist Patches currently in -mm which might be from ananth@xxxxxxxxxx are origin.patch linux-next.patch kprobes-initialize-before-using-a-hlist.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html