[PATCH v2 15/15] kprobes: Free kretprobe_instance with rcu callback

2020-08-27 Thread Masami Hiramatsu
Free kretprobe_instance with rcu callback instead of directly freeing the object in the kretprobe handler context. This will make kretprobe run safer in NMI context. Signed-off-by: Masami Hiramatsu --- include/linux/kprobes.h |3 ++- kernel/kprobes.c| 25 ++---

Re: [PATCH v2 15/15] kprobes: Free kretprobe_instance with rcu callback

2020-08-27 Thread peterz
On Thu, Aug 27, 2020 at 08:37:49PM +0900, Masami Hiramatsu wrote: > Free kretprobe_instance with rcu callback instead of directly > freeing the object in the kretprobe handler context. > > This will make kretprobe run safer in NMI context. > > Signed-off-by: Masami Hiramatsu > --- > include/lin

Re: [PATCH v2 15/15] kprobes: Free kretprobe_instance with rcu callback

2020-08-27 Thread Masami Hiramatsu
On Thu, 27 Aug 2020 13:49:19 +0200 pet...@infradead.org wrote: > On Thu, Aug 27, 2020 at 08:37:49PM +0900, Masami Hiramatsu wrote: > > > +void recycle_rp_inst(struct kretprobe_instance *ri) > > Also note, that at this point there is no external caller of this > function anymore. OK, actually, t

Re: [PATCH v2 15/15] kprobes: Free kretprobe_instance with rcu callback

2020-08-27 Thread peterz
On Thu, Aug 27, 2020 at 08:37:49PM +0900, Masami Hiramatsu wrote: > +void recycle_rp_inst(struct kretprobe_instance *ri) Also note, that at this point there is no external caller of this function anymore.

Re: [PATCH v2 15/15] kprobes: Free kretprobe_instance with rcu callback

2020-08-27 Thread Masami Hiramatsu
On Thu, 27 Aug 2020 13:48:07 +0200 pet...@infradead.org wrote: > On Thu, Aug 27, 2020 at 08:37:49PM +0900, Masami Hiramatsu wrote: > > Free kretprobe_instance with rcu callback instead of directly > > freeing the object in the kretprobe handler context. > > > > This will make kretprobe run safer