Re: [RFC][PATCH 7/7] kprobes: Replace rp->free_instance with freelist

2020-08-29 Thread Masami Hiramatsu
On Fri, 28 Aug 2020 22:31:17 -0400 Cameron wrote: > On Fri, Aug 28, 2020 at 10:29 PM Cameron wrote: > > I thought about this some more, and actually, it should be safe. > > Although I should note that it's important that the flags/refcount are > not overwritten > even after the node is taken of

Re: [RFC][PATCH 7/7] kprobes: Replace rp->free_instance with freelist

2020-08-28 Thread Cameron
On Fri, Aug 28, 2020 at 10:29 PM Cameron wrote: > I thought about this some more, and actually, it should be safe. Although I should note that it's important that the flags/refcount are not overwritten even after the node is taken off the freelist. Cameron

Re: [RFC][PATCH 7/7] kprobes: Replace rp->free_instance with freelist

2020-08-28 Thread Cameron
On Fri, Aug 28, 2020 at 5:18 AM wrote: > So the freelist->refs thing is supposed to pin freelist->next for > concurrent usage, but if we instantly stick it on the > current->kretprobe_instances llist while it's still elevated, we'll > overwrite ->next, which would be bad. I thought about this som

Re: [RFC][PATCH 7/7] kprobes: Replace rp->free_instance with freelist

2020-08-28 Thread Masami Hiramatsu
On Fri, 28 Aug 2020 11:18:13 +0200 pet...@infradead.org wrote: > On Fri, Aug 28, 2020 at 06:13:41PM +0900, Masami Hiramatsu wrote: > > On Fri, 28 Aug 2020 10:48:51 +0200 > > pet...@infradead.org wrote: > > > > > On Thu, Aug 27, 2020 at 06:12:44PM +0200, Peter Zijlstra wrote: > > > > struct kretp

Re: [RFC][PATCH 7/7] kprobes: Replace rp->free_instance with freelist

2020-08-28 Thread peterz
On Fri, Aug 28, 2020 at 06:13:41PM +0900, Masami Hiramatsu wrote: > On Fri, 28 Aug 2020 10:48:51 +0200 > pet...@infradead.org wrote: > > > On Thu, Aug 27, 2020 at 06:12:44PM +0200, Peter Zijlstra wrote: > > > struct kretprobe_instance { > > > union { > > > + /* > > > + * Dodgy

Re: [RFC][PATCH 7/7] kprobes: Replace rp->free_instance with freelist

2020-08-28 Thread Masami Hiramatsu
On Fri, 28 Aug 2020 10:48:51 +0200 pet...@infradead.org wrote: > On Thu, Aug 27, 2020 at 06:12:44PM +0200, Peter Zijlstra wrote: > > struct kretprobe_instance { > > union { > > + /* > > +* Dodgy as heck, this relies on not clobbering freelist::refs. > > +* ll

Re: [RFC][PATCH 7/7] kprobes: Replace rp->free_instance with freelist

2020-08-28 Thread peterz
On Thu, Aug 27, 2020 at 06:12:44PM +0200, Peter Zijlstra wrote: > struct kretprobe_instance { > union { > + /* > + * Dodgy as heck, this relies on not clobbering freelist::refs. > + * llist: only clobbers freelist::next. > + * rcu: clobbers