Skip to contentSkip to conversation

kretprobe spinlock deadlock patch

PATCH In review bibo,mao 2 participants 2 messages Sep 26, 2006

Subsystems (3)
lore
Share & tools
lore

bibo,mao

author
#0 lore raw

PATCH 3/3 kretprobe spinlock deadlock patch

Hi,
Function kprobe_flush_task possibly calls kfree function during holding kretprobe_lock spinlock, if kfree function is probed by kretprobe that will incur spinlock deadlock. This patch moves kfree function out scope of kretprobe_lock.

thanks
bibo,mao

arch/i386/kernel/kprobes.c    |    9 +++++++--
arch/ia64/kernel/kprobes.c    |    9 +++++++--
arch/powerpc/kernel/kprobes.c |    9 +++++++--
arch/s390/kernel/kprobes.c    |    9 +++++++--
arch/x86_64/kernel/kprobes.c  |    9 +++++++--
include/linux/kprobes.h       |    2 +-
kernel/kprobes.c              |   15 +++++++++++----
7 files changed, 47 insertions(+), 15 deletions(-)
arch/i386/kernel/kprobes.c +0 -0
diff -Nruap 2.6.18-mm1.org/arch/i386/kernel/kprobes.c 2.6.18-mm1/arch/i386/kernel/kprobes.c
@@ -396,11 +396,12 @@ no_kprobe:

fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)

{
	struct kretprobe_instance *ri = NULL;
-	struct hlist_head *head;
+	struct hlist_head *head, empty_rp;
	struct hlist_node *node, *tmp;
	unsigned long flags, orig_ret_address = 0;
	unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
+	INIT_HLIST_HEAD(&empty_rp);
	spin_lock_irqsave(&kretprobe_lock, flags);
	head = kretprobe_inst_table_head(current);

@@ -429,7 +430,7 @@ fastcall void *__kprobes trampoline_hand

		}

		orig_ret_address = (unsigned long)ri->ret_addr;

- recycle_rp_inst(ri);
+ recycle_rp_inst(ri, &empty_rp);

		if (orig_ret_address != trampoline_address)
			/*

@@ -444,6 +445,10 @@ fastcall void *__kprobes trampoline_hand

	spin_unlock_irqrestore(&kretprobe_lock, flags);

+ hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+ hlist_del(&ri->hlist);
+ kfree(ri);
+ }

	return (void*)orig_ret_address;
}
arch/ia64/kernel/kprobes.c +0 -0
diff -Nruap 2.6.18-mm1.org/arch/ia64/kernel/kprobes.c 2.6.18-mm1/arch/ia64/kernel/kprobes.c
@@ -340,12 +340,13 @@ static void kretprobe_trampoline(void)

int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)

{
	struct kretprobe_instance *ri = NULL;
-	struct hlist_head *head;
+	struct hlist_head *head, empty_rp;
	struct hlist_node *node, *tmp;
	unsigned long flags, orig_ret_address = 0;
	unsigned long trampoline_address =
		((struct fnptr *)kretprobe_trampoline)->ip;
+	INIT_HLIST_HEAD(&empty_rp);
	spin_lock_irqsave(&kretprobe_lock, flags);
	head = kretprobe_inst_table_head(current);

@@ -371,7 +372,7 @@ int __kprobes trampoline_probe_handler(s

			ri->rp->handler(ri, regs);

		orig_ret_address = (unsigned long)ri->ret_addr;

- recycle_rp_inst(ri);
+ recycle_rp_inst(ri, &empty_rp);

		if (orig_ret_address != trampoline_address)
			/*
@@ -389,6 +390,10 @@ int __kprobes trampoline_probe_handler(s
	spin_unlock_irqrestore(&kretprobe_lock, flags);
	preempt_enable_no_resched();

+ hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+ hlist_del(&ri->hlist);
+ kfree(ri);
+ }
/*
* By returning a non-zero value, we are telling
* kprobe_handler() that we don't want the post_handler

arch/powerpc/kernel/kprobes.c +0 -0
diff -Nruap 2.6.18-mm1.org/arch/powerpc/kernel/kprobes.c 2.6.18-mm1/arch/powerpc/kernel/kprobes.c
@@ -260,11 +260,12 @@ void kretprobe_trampoline_holder(void)

int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)

{
	struct kretprobe_instance *ri = NULL;
-	struct hlist_head *head;
+	struct hlist_head *head, empty_rp;
	struct hlist_node *node, *tmp;
	unsigned long flags, orig_ret_address = 0;
	unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
+	INIT_HLIST_HEAD(&empty_rp);
	spin_lock_irqsave(&kretprobe_lock, flags);
	head = kretprobe_inst_table_head(current);

@@ -290,7 +291,7 @@ int __kprobes trampoline_probe_handler(s

			ri->rp->handler(ri, regs);

		orig_ret_address = (unsigned long)ri->ret_addr;

- recycle_rp_inst(ri);
+ recycle_rp_inst(ri, &empty_rp);

		if (orig_ret_address != trampoline_address)
			/*
@@ -308,6 +309,10 @@ int __kprobes trampoline_probe_handler(s
	spin_unlock_irqrestore(&kretprobe_lock, flags);
	preempt_enable_no_resched();

+ hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+ hlist_del(&ri->hlist);
+ kfree(ri);
+ }
/*
* By returning a non-zero value, we are telling
* kprobe_handler() that we don't want the post_handler

arch/s390/kernel/kprobes.c +0 -0
diff -Nruap 2.6.18-mm1.org/arch/s390/kernel/kprobes.c 2.6.18-mm1/arch/s390/kernel/kprobes.c
@@ -368,11 +368,12 @@ void __kprobes kretprobe_trampoline_hold

int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)

{
	struct kretprobe_instance *ri = NULL;
-	struct hlist_head *head;
+	struct hlist_head *head, empty_rp;
	struct hlist_node *node, *tmp;
	unsigned long flags, orig_ret_address = 0;
	unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
+	INIT_HLIST_HEAD(&empty_rp);
	spin_lock_irqsave(&kretprobe_lock, flags);
	head = kretprobe_inst_table_head(current);

@@ -398,7 +399,7 @@ int __kprobes trampoline_probe_handler(s

			ri->rp->handler(ri, regs);

		orig_ret_address = (unsigned long)ri->ret_addr;

- recycle_rp_inst(ri);
+ recycle_rp_inst(ri, &empty_rp);

		if (orig_ret_address != trampoline_address) {
			/*
@@ -416,6 +417,10 @@ int __kprobes trampoline_probe_handler(s
	spin_unlock_irqrestore(&kretprobe_lock, flags);
	preempt_enable_no_resched();

+ hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+ hlist_del(&ri->hlist);
+ kfree(ri);
+ }
/*
* By returning a non-zero value, we are telling
* kprobe_handler() that we don't want the post_handler

arch/x86_64/kernel/kprobes.c +0 -0
diff -Nruap 2.6.18-mm1.org/arch/x86_64/kernel/kprobes.c 2.6.18-mm1/arch/x86_64/kernel/kprobes.c
@@ -405,11 +405,12 @@ no_kprobe:

int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)

{
	struct kretprobe_instance *ri = NULL;
-	struct hlist_head *head;
+	struct hlist_head *head, empty_rp;
	struct hlist_node *node, *tmp;
	unsigned long flags, orig_ret_address = 0;
	unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
+	INIT_HLIST_HEAD(&empty_rp);
	spin_lock_irqsave(&kretprobe_lock, flags);
	head = kretprobe_inst_table_head(current);

@@ -435,7 +436,7 @@ int __kprobes trampoline_probe_handler(s

			ri->rp->handler(ri, regs);

		orig_ret_address = (unsigned long)ri->ret_addr;

- recycle_rp_inst(ri);
+ recycle_rp_inst(ri, &empty_rp);

		if (orig_ret_address != trampoline_address)
			/*
@@ -453,6 +454,10 @@ int __kprobes trampoline_probe_handler(s
	spin_unlock_irqrestore(&kretprobe_lock, flags);
	preempt_enable_no_resched();

+ hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+ hlist_del(&ri->hlist);
+ kfree(ri);
+ }
/*
* By returning a non-zero value, we are telling
* kprobe_handler() that we don't want the post_handler

include/linux/kprobes.h +0 -0
diff -Nruap 2.6.18-mm1.org/include/linux/kprobes.h 2.6.18-mm1/include/linux/kprobes.h
@@ -202,7 +202,7 @@ void unregister_kretprobe(struct kretpro

struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp); void add_rp_inst(struct kretprobe_instance *ri);
void kprobe_flush_task(struct task_struct *tk);
-void recycle_rp_inst(struct kretprobe_instance *ri);
+void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); #else /* CONFIG_KPROBES */

#define __kprobes /**/

kernel/kprobes.c +0 -0
diff -Nruap 2.6.18-mm1.org/kernel/kprobes.c 2.6.18-mm1/kernel/kprobes.c
@@ -319,7 +319,8 @@ void __kprobes add_rp_inst(struct kretpr

}

/* Called with kretprobe_lock held */
-void __kprobes recycle_rp_inst(struct kretprobe_instance *ri) +void __kprobes recycle_rp_inst(struct kretprobe_instance *ri,
+ struct hlist_head *head)

{
	/* remove rp inst off the rprobe_inst_table */
	hlist_del(&ri->hlist);
@@ -331,7 +332,7 @@ void __kprobes recycle_rp_inst(struct kr
		hlist_add_head(&ri->uflist, &ri->rp->free_instances);
	} else
		/* Unregistering */

- kfree(ri);
+ hlist_add_head(&ri->hlist, head);
}

struct hlist_head __kprobes *kretprobe_inst_table_head(struct task_struct *tsk) @@ -348,17 +349,23 @@ struct hlist_head __kprobes *kretprobe_i void __kprobes kprobe_flush_task(struct task_struct *tk)

{
	struct kretprobe_instance *ri;
-	struct hlist_head *head;
+	struct hlist_head *head, empty_rp;
	struct hlist_node *node, *tmp;
	unsigned long flags = 0;
+	INIT_HLIST_HEAD(&empty_rp);
	spin_lock_irqsave(&kretprobe_lock, flags);
	head = kretprobe_inst_table_head(tk);
	hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
		if (ri->task == tk)
-			recycle_rp_inst(ri);
+			recycle_rp_inst(ri, &empty_rp);
	}
	spin_unlock_irqrestore(&kretprobe_lock, flags);

+
+ hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+ hlist_del(&ri->hlist);
+ kfree(ri);
+ }
}

static inline void free_rp_inst(struct kretprobe *rp)

#1 lore raw
Quoted 251 lines · bibo,mao

Hi,
Function kprobe_flush_task possibly calls kfree function during holding kretprobe_lock spinlock, if kfree function is probed by kretprobe that will incur spinlock deadlock. This patch moves kfree function out scope of kretprobe_lock.

thanks
bibo,mao

arch/i386/kernel/kprobes.c    |    9 +++++++--
arch/ia64/kernel/kprobes.c    |    9 +++++++--
arch/powerpc/kernel/kprobes.c |    9 +++++++--
arch/s390/kernel/kprobes.c    |    9 +++++++--
arch/x86_64/kernel/kprobes.c  |    9 +++++++--
include/linux/kprobes.h       |    2 +-
kernel/kprobes.c              |   15 +++++++++++----
7 files changed, 47 insertions(+), 15 deletions(-)

diff -Nruap 2.6.18-mm1.org/arch/i386/kernel/kprobes.c 2.6.18-mm1/arch/i386/kernel/kprobes.c
--- 2.6.18-mm1.org/arch/i386/kernel/kprobes.c 2006-09-26
10:49:26.000000000 +0800
+++ 2.6.18-mm1/arch/i386/kernel/kprobes.c 2006-09-26
10:53:16.000000000 +0800

(quoted diff) +7 -2
@@ -396,11 +396,12 @@ no_kprobe:
 fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
 {
    struct kretprobe_instance *ri = NULL;
-    struct hlist_head *head;
+    struct hlist_head *head, empty_rp;
    struct hlist_node *node, *tmp;
    unsigned long flags, orig_ret_address = 0;
    unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
 
+    INIT_HLIST_HEAD(&empty_rp);
    spin_lock_irqsave(&kretprobe_lock, flags);
    head = kretprobe_inst_table_head(current);
 
@@ -429,7 +430,7 @@ fastcall void *__kprobes trampoline_hand
        }
 
        orig_ret_address = (unsigned long)ri->ret_addr;
-        recycle_rp_inst(ri);
+        recycle_rp_inst(ri, &empty_rp);
 
        if (orig_ret_address != trampoline_address)
            /*
@@ -444,6 +445,10 @@ fastcall void *__kprobes trampoline_hand
 
    spin_unlock_irqrestore(&kretprobe_lock, flags);
 
+    hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+        hlist_del(&ri->hlist);
+        kfree(ri);
+    }
    return (void*)orig_ret_address;
 }
 

diff -Nruap 2.6.18-mm1.org/arch/ia64/kernel/kprobes.c 2.6.18-mm1/arch/ia64/kernel/kprobes.c
--- 2.6.18-mm1.org/arch/ia64/kernel/kprobes.c 2006-09-26
10:49:26.000000000 +0800
+++ 2.6.18-mm1/arch/ia64/kernel/kprobes.c 2006-09-26
10:53:16.000000000 +0800

(quoted diff) +7 -2
@@ -340,12 +340,13 @@ static void kretprobe_trampoline(void)
 int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
 {
    struct kretprobe_instance *ri = NULL;
-    struct hlist_head *head;
+    struct hlist_head *head, empty_rp;
    struct hlist_node *node, *tmp;
    unsigned long flags, orig_ret_address = 0;
    unsigned long trampoline_address =
        ((struct fnptr *)kretprobe_trampoline)->ip;
 
+    INIT_HLIST_HEAD(&empty_rp);
    spin_lock_irqsave(&kretprobe_lock, flags);
    head = kretprobe_inst_table_head(current);
 
@@ -371,7 +372,7 @@ int __kprobes trampoline_probe_handler(s
            ri->rp->handler(ri, regs);
 
        orig_ret_address = (unsigned long)ri->ret_addr;
-        recycle_rp_inst(ri);
+        recycle_rp_inst(ri, &empty_rp);
 
        if (orig_ret_address != trampoline_address)
            /*
@@ -389,6 +390,10 @@ int __kprobes trampoline_probe_handler(s
    spin_unlock_irqrestore(&kretprobe_lock, flags);
    preempt_enable_no_resched();
 
+    hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+        hlist_del(&ri->hlist);
+        kfree(ri);
+    }
    /*
     * By returning a non-zero value, we are telling
     * kprobe_handler() that we don't want the post_handler

diff -Nruap 2.6.18-mm1.org/arch/powerpc/kernel/kprobes.c 2.6.18-mm1/arch/powerpc/kernel/kprobes.c
--- 2.6.18-mm1.org/arch/powerpc/kernel/kprobes.c 2006-09-26
10:49:26.000000000 +0800
+++ 2.6.18-mm1/arch/powerpc/kernel/kprobes.c 2006-09-26
10:53:16.000000000 +0800

(quoted diff) +7 -2
@@ -260,11 +260,12 @@ void kretprobe_trampoline_holder(void)
 int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
 {
    struct kretprobe_instance *ri = NULL;
-    struct hlist_head *head;
+    struct hlist_head *head, empty_rp;
    struct hlist_node *node, *tmp;
    unsigned long flags, orig_ret_address = 0;
    unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
 
+    INIT_HLIST_HEAD(&empty_rp);
    spin_lock_irqsave(&kretprobe_lock, flags);
    head = kretprobe_inst_table_head(current);
 
@@ -290,7 +291,7 @@ int __kprobes trampoline_probe_handler(s
            ri->rp->handler(ri, regs);
 
        orig_ret_address = (unsigned long)ri->ret_addr;
-        recycle_rp_inst(ri);
+        recycle_rp_inst(ri, &empty_rp);
 
        if (orig_ret_address != trampoline_address)
            /*
@@ -308,6 +309,10 @@ int __kprobes trampoline_probe_handler(s
    spin_unlock_irqrestore(&kretprobe_lock, flags);
    preempt_enable_no_resched();
 
+    hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+        hlist_del(&ri->hlist);
+        kfree(ri);
+    }
    /*
     * By returning a non-zero value, we are telling
     * kprobe_handler() that we don't want the post_handler

diff -Nruap 2.6.18-mm1.org/arch/s390/kernel/kprobes.c 2.6.18-mm1/arch/s390/kernel/kprobes.c
--- 2.6.18-mm1.org/arch/s390/kernel/kprobes.c 2006-09-25
16:11:56.000000000 +0800
+++ 2.6.18-mm1/arch/s390/kernel/kprobes.c 2006-09-26
10:53:16.000000000 +0800

(quoted diff) +7 -2
@@ -368,11 +368,12 @@ void __kprobes kretprobe_trampoline_hold
 int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
 {
    struct kretprobe_instance *ri = NULL;
-    struct hlist_head *head;
+    struct hlist_head *head, empty_rp;
    struct hlist_node *node, *tmp;
    unsigned long flags, orig_ret_address = 0;
    unsigned long trampoline_address = (unsigned 
 long)&kretprobe_trampoline;
 
+    INIT_HLIST_HEAD(&empty_rp);
    spin_lock_irqsave(&kretprobe_lock, flags);
    head = kretprobe_inst_table_head(current);
@@ -398,7 +399,7 @@ int __kprobes trampoline_probe_handler(s
            ri->rp->handler(ri, regs);
 
        orig_ret_address = (unsigned long)ri->ret_addr;
-        recycle_rp_inst(ri);
+        recycle_rp_inst(ri, &empty_rp);
 
        if (orig_ret_address != trampoline_address) {
            /*
@@ -416,6 +417,10 @@ int __kprobes trampoline_probe_handler(s
    spin_unlock_irqrestore(&kretprobe_lock, flags);
    preempt_enable_no_resched();
 
+    hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+        hlist_del(&ri->hlist);
+        kfree(ri);
+    }
    /*
     * By returning a non-zero value, we are telling
     * kprobe_handler() that we don't want the post_handler

diff -Nruap 2.6.18-mm1.org/arch/x86_64/kernel/kprobes.c 2.6.18-mm1/arch/x86_64/kernel/kprobes.c
--- 2.6.18-mm1.org/arch/x86_64/kernel/kprobes.c 2006-09-26
10:49:26.000000000 +0800
+++ 2.6.18-mm1/arch/x86_64/kernel/kprobes.c 2006-09-26
10:53:16.000000000 +0800

(quoted diff) +7 -2
@@ -405,11 +405,12 @@ no_kprobe:
 int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
 {
    struct kretprobe_instance *ri = NULL;
-    struct hlist_head *head;
+    struct hlist_head *head, empty_rp;
    struct hlist_node *node, *tmp;
    unsigned long flags, orig_ret_address = 0;
    unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
 
+    INIT_HLIST_HEAD(&empty_rp);
    spin_lock_irqsave(&kretprobe_lock, flags);
    head = kretprobe_inst_table_head(current);
 
@@ -435,7 +436,7 @@ int __kprobes trampoline_probe_handler(s
            ri->rp->handler(ri, regs);
 
        orig_ret_address = (unsigned long)ri->ret_addr;
-        recycle_rp_inst(ri);
+        recycle_rp_inst(ri, &empty_rp);
 
        if (orig_ret_address != trampoline_address)
            /*
@@ -453,6 +454,10 @@ int __kprobes trampoline_probe_handler(s
    spin_unlock_irqrestore(&kretprobe_lock, flags);
    preempt_enable_no_resched();
 
+    hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+        hlist_del(&ri->hlist);
+        kfree(ri);
+    }
    /*
     * By returning a non-zero value, we are telling
     * kprobe_handler() that we don't want the post_handler

diff -Nruap 2.6.18-mm1.org/include/linux/kprobes.h 2.6.18-mm1/include/linux/kprobes.h
--- 2.6.18-mm1.org/include/linux/kprobes.h 2006-09-25
16:12:04.000000000 +0800
+++ 2.6.18-mm1/include/linux/kprobes.h 2006-09-26 10:53:16.000000000
+0800

(quoted diff) +1 -1
@@ -202,7 +202,7 @@ void unregister_kretprobe(struct kretpro
 struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp);
 void add_rp_inst(struct kretprobe_instance *ri);
 void kprobe_flush_task(struct task_struct *tk);
-void recycle_rp_inst(struct kretprobe_instance *ri);
+void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head 
 *head);
 #else /* CONFIG_KPROBES */
 

#define __kprobes /**/
diff -Nruap 2.6.18-mm1.org/kernel/kprobes.c 2.6.18-mm1/kernel/kprobes.c

kernel/kprobes.c 2006-09-26 10:53:16.000000000 +0800 renamed from kernel/kprobes.c 2006-09-26 10:49:26.000000000 +0800 +3 -2
@@ -319,7 +319,8 @@ void __kprobes add_rp_inst(struct kretpr
 }
 
 /* Called with kretprobe_lock held */
-void __kprobes recycle_rp_inst(struct kretprobe_instance *ri)
+void __kprobes recycle_rp_inst(struct kretprobe_instance *ri,
+                struct hlist_head *head)
 {
    /* remove rp inst off the rprobe_inst_table */
    hlist_del(&ri->hlist);
@@ -331,7 +332,7 @@ void __kprobes recycle_rp_inst(struct kr
        hlist_add_head(&ri->uflist, &ri->rp->free_instances);
    } else
        /* Unregistering */
-        kfree(ri);
+        hlist_add_head(&ri->hlist, head);
 }
 
 struct hlist_head __kprobes *kretprobe_inst_table_head(struct task_struct *tsk)

kernel/kprobes.c 2006-09-26 10:53:16.000000000 +0800 struct hlist_head __kprobes *kretprobe_i · line 356

Quoted 9 lines
kernel/kprobes.c 2006-09-26 10:53:16.000000000 +0800 renamed from kernel/kprobes.c 2006-09-26 10:49:26.000000000 +0800 +2 -1
@@ -348,17 +349,23 @@ struct hlist_head __kprobes *kretprobe_i
 void __kprobes kprobe_flush_task(struct task_struct *tk)
 {
    struct kretprobe_instance *ri;
-    struct hlist_head *head;
+    struct hlist_head *head, empty_rp;
    struct hlist_node *node, *tmp;
    unsigned long flags = 0;
 
+    INIT_HLIST_HEAD(&empty_rp);

HLIST_HEAD(empty_rp); instead of that 2 changes?

Quoted 6 lines
kernel/kprobes.c 2006-09-26 10:53:16.000000000 +0800 renamed from kernel/kprobes.c 2006-09-26 10:49:26.000000000 +0800 +1 -1
    spin_lock_irqsave(&kretprobe_lock, flags);
    head = kretprobe_inst_table_head(tk);
    hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
        if (ri->task == tk)
-            recycle_rp_inst(ri);
+            recycle_rp_inst(ri, &empty_rp);

kernel/kprobes.c 2006-09-26 10:53:16.000000000 +0800 struct hlist_head __kprobes *kretprobe_i · line 371

Quoted 10 lines
kernel/kprobes.c 2006-09-26 10:53:16.000000000 +0800 renamed from kernel/kprobes.c 2006-09-26 10:49:26.000000000 +0800 +5 -0
    }
    spin_unlock_irqrestore(&kretprobe_lock, flags);
+
+    hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
+        hlist_del(&ri->hlist);
+        kfree(ri);
+    }
 }
 
 static inline void free_rp_inst(struct kretprobe *rp)

regards,

Signature · 4 lines
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E