Re: [PATCH] Don't oops when unregistering unknown kprobes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le 27/04/05 00:09 +0200, Jesper Juhl écrivit:
> On Tue, 26 Apr 2005, Frederik Deweerdt wrote:
> Seems to me this will end up calling spin_lock_irqsave() twice, but only 
> spin_unlock_irqrestore once in the non-failing case... hmm..

Indeed, I made an obvious mistake there, sorry.

> 
> Also, as Chris Wedgwood asked, why not simply  return -EINVAL;  instead of 
> the printk()?  Does the user really care that we tried to unregister a 
> nonexisting kprobe? and if you really think someone would like to know 
> then I'd personally say that KERN_DEBUG should be sufficient.

I wanted to make the patch minimal, but it does make sense. 

> I'd suggest something like this :
> [ ... ]

You should also change the prototype in include/kernel/kprobes.h:

--- linux-2.6.12-rc3/include/linux/kprobes.h    2005-03-02 08:37:50.000000000 +0100
+++ linux-2.6.12-rc3-devel/include/linux/kprobes.h      2005-04-27 00:23:09.000000000 +0200
@@ -103,7 +103,7 @@ extern void show_registers(struct pt_reg
 struct kprobe *get_kprobe(void *addr);
 
 int register_kprobe(struct kprobe *p);
-void unregister_kprobe(struct kprobe *p);
+int unregister_kprobe(struct kprobe *p);
 int setjmp_pre_handler(struct kprobe *, struct pt_regs *);
 int longjmp_break_handler(struct kprobe *, struct pt_regs *);
 int register_jprobe(struct jprobe *p);

Regards,
Frederik
PS: I've fixed my mailing habits, sorry for inconvenience :)

-- 
o----------------------------------------------o
| http://open-news.net : l'info alternative    |
| Tech - Sciences - Politique - International  |
o----------------------------------------------o
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux